From e22f1ee5203faf0f33abf02b92cb0a0d3f30a801 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 16 Feb 2006 16:36:09 -0500
Subject: [PATCH] Updates mail module
---
interface/web/mail/lib/lang/en_mail_whitelist.lng | 15
interface/web/mail/mail_domain_catchall_list.php | 0
interface/web/mail/mail_spamfilter_del.php | 107
interface/web/mail/mail_forward_del.php | 0
interface/web/mail/lib/lang/en_mail_domain_alias_list.lng | 25
interface/web/mail/mail_box_edit.php | 213
interface/web/mail/lib/lang/se_mail_box_list.lng | 0
interface/web/mail/mail_forward_edit.php | 0
interface/web/mail/lib/lang/en_mail_spamfilter.lng | 19
interface/web/mail/lib/lang/en_mail_whitelist_list.lng | 24
interface/web/mail/list/mail_blacklist.list.php | 160
interface/web/mail/lib/lang/se_mail_whitelist.lng | 0
interface/web/mail/list/mail_whitelist.list.php | 160
interface/web/mail/lib/lang/en_mail_blacklist_list.lng | 24
interface/web/mail/list/mail_forward.list.php | 0
interface/web/mail/lib/lang/en_mail_domain_catchall_list.lng | 25
interface/web/mail/mail_domain_relay_edit.php | 0
interface/web/mail/lib/lang/en_mail_alias.lng | 19
interface/web/mail/mail_blacklist_edit.php | 208
interface/web/mail/mail_domain_alias_list.php | 0
interface/web/mail/mail_spamfilter_edit.php | 229
interface/web/mail/mail_whitelist_del.php | 0
interface/sql/ispconfig3db.sql | 529 +--
interface/web/mail/mail_domain_relay_del.php | 0
interface/web/mail/mail_forward_list.php | 0
interface/web/mail/templates/mail_alias_list.htm | 0
interface/web/mail/lib/lang/se_mail_domain_relay.lng | 0
interface/web/mail/mail_alias_list.php | 0
interface/web/mail/list/mail_domain_catchall.list.php | 159
interface/web/mail/lib/lang/en_mail_domain_relay_list.lng | 23
interface/web/mail/lib/lang/se_mail_box.lng | 0
interface/web/mail/list/mail_domain_alias.list.php | 167
interface/web/mail/form/mail_whitelist.tform.php | 198
interface/web/mail/mail_domain_relay_list.php | 0
interface/lib/classes/ini_parser.inc.php | 122
interface/web/mail/mail_domain_list.php | 0
interface/web/mail/form/mail_domain_alias.tform.php | 234
interface/web/mail/lib/lang/en_mail_forward.lng | 0
interface/web/mail/lib/lang/en_mail_blacklist.lng | 15
interface/web/mail/form/mail_domain.tform.php | 209
interface/web/mail/mail_domain_catchall_del.php | 0
interface/web/mail/list/mail_alias.list.php | 0
interface/web/mail/form/mail_spamfilter.tform.php | 146 +
interface/web/mail/mail_spamfilter_list.php | 26
interface/web/mail/templates/mail_domain_list.htm | 53
interface/web/mail/mail_alias_del.php | 0
interface/web/mail/lib/lang/se_mail_domain.lng | 0
interface/web/mail/mail_whitelist_edit.php | 208
interface/web/mail/templates/mail_spamfilter_list.htm | 30
interface/web/mail/templates/mail_forward_edit.htm | 0
interface/web/mail/templates/mail_blacklist_list.htm | 32
interface/web/mail/mail_blacklist_list.php | 0
interface/web/mail/templates/mail_domain_alias_list.htm | 61
interface/web/mail/lib/lang/en_mail_alias_list.lng | 0
interface/web/mail/templates/mail_box_mailbox_edit.htm | 50
interface/web/mail/lib/lang/en_mail_forward_list.lng | 0
interface/web/mail/lib/lang/se_mail_domain_list.lng | 0
interface/lib/classes/tform.inc.php | 1786 ++++++------
interface/web/mail/lib/lang/fr_mail_domain_list.lng | 0
interface/web/mail/lib/lang/en_mail_spamfilter_list.lng | 13
interface/web/mail/mail_alias_edit.php | 0
interface/web/mail/mail_domain_route_list.php | 30
config/exim4/exim4.conf.template | 35
interface/web/mail/mail_blacklist_del.php | 0
interface/web/mail/lib/lang/se_mail_alias.lng | 0
interface/web/mail/lib/lang/se_mail_alias_list.lng | 0
interface/web/mail/mail_domain_alias_edit.php | 0
interface/web/mail/mail_domain_catchall_edit.php | 0
interface/web/mail/templates/mail_blacklist_edit.htm | 58
interface/web/mail/lib/lang/en_mail_box_list.lng | 0
interface/web/mail/templates/mail_forward_list.htm | 0
interface/web/mail/lib/lang/fr_mail_domain.lng | 0
interface/web/mail/mail_domain_del.php | 0
interface/web/mail/templates/mail_domain_relay_list.htm | 54
interface/web/mail/lib/lang/en_mail_domain_list.lng | 23
interface/web/mail/lib/lang/en_mail_domain.lng | 22
interface/web/mail/lib/lang/se_mail_domain_catchall_list.lng | 0
interface/web/mail/lib/lang/en_mail_box.lng | 26
interface/web/mail/mail_box_del.php | 0
interface/web/mail/form/mail_alias.tform.php | 223
interface/web/mail/lib/lang/se_mail_forward.lng | 0
interface/web/mail/lib/admin.conf.php | 0
interface/web/mail/form/mail_domain_catchall.tform.php | 209
interface/web/mail/lib/lang/se_mail_domain_catchall.lng | 0
interface/web/mail/lib/lang/se_mail_blacklist_list.lng | 0
interface/web/mail/templates/mail_whitelist_edit.htm | 58
interface/web/mail/templates/mail_spamfilter_edit.htm | 66
interface/lib/config.inc.php | 196
interface/web/mail/mail_domain_route_edit.php | 5
interface/web/mail/lib/lang/se_mail_forward_list.lng | 0
interface/web/mail/form/mail_forward.tform.php | 0
interface/web/mail/templates/mail_domain_catchall_edit.htm | 0
interface/web/mail/templates/mail_domain_alias_edit.htm | 0
interface/web/mail/templates/mail_box_list.htm | 0
interface/web/mail/lib/lang/en_mail_domain_alias.lng | 13
interface/web/mail/list/mail_domain_relay.list.php | 149
interface/web/mail/lib/lang/se_mail_blacklist.lng | 0
interface/web/mail/list/mail_spamfilter.list.php | 85
interface/web/mail/mail_domain_alias_del.php | 0
interface/web/mail/lib/lang/se_mail_domain_alias_list.lng | 0
interface/web/mail/list/mail_box.list.php | 0
interface/web/mail/lib/module.conf.php | 109
interface/web/mail/lib/lang/se_mail_domain_alias.lng | 0
interface/lib/classes/getconf.inc.php | 113
interface/lib/classes/listform.inc.php | 590 ++-
interface/web/mail/list/mail_domain.list.php | 152
interface/web/mail/mail_box_list.php | 0
interface/web/mail/mail_domain_edit.php | 0
interface/web/mail/templates/mail_domain_catchall_list.htm | 61
interface/web/mail/form/mail_blacklist.tform.php | 198
interface/web/mail/templates/mail_domain_relay_edit.htm | 0
interface/web/mail/templates/mail_domain_edit.htm | 0
/dev/null | 27
interface/web/mail/mail_domain_route_del.php | 13
interface/web/mail/mail_whitelist_list.php | 0
interface/web/mail/templates/mail_box_autoresponder_edit.htm | 0
interface/web/mail/templates/mail_whitelist_list.htm | 32
interface/web/mail/lib/lang/en_mail_domain_catchall.lng | 17
interface/web/mail/templates/mail_alias_edit.htm | 0
interface/web/mail/form/mail_box.tform.php | 281 +
interface/web/mail/lib/lang/en_mail_domain_relay.lng | 18
interface/web/mail/form/mail_domain_relay.tform.php | 209
interface/web/mail/lib/lang/se_mail_domain_relay_list.lng | 0
interface/web/mail/lib/lang/se_mail_whitelist_list.lng | 0
124 files changed, 4,587 insertions(+), 3,774 deletions(-)
diff --git a/config/exim4/exim4.conf.template b/config/exim4/exim4.conf.template
index ac9ad56..20bdcba 100644
--- a/config/exim4/exim4.conf.template
+++ b/config/exim4/exim4.conf.template
@@ -126,8 +126,11 @@
domains = +local_domains
require verify = sender
+
+ # Whitelist
+
- # Blacklist management
+ # Blacklist
deny senders = ${lookup mysql {SELECT DISTINCT address FROM MYSQL_BLACKTABLE WHERE '${quote_mysql:$sender_address}' LIKE address \
AND (recipient = '' OR recipient = '${quote_mysql:$domain}' OR recipient = '${quote_mysql:$local_part}@${quote_mysql:$domain}') \
AND active = '1' AND server_id = 'MAILSERVER_ID'}{$value}}
@@ -159,11 +162,11 @@
acl_check_helo:
accept hosts = +relay_from_hosts
- # If the HELO pretend to be this host
- deny condition = ${if or { \
- {eq {${lc:$sender_helo_name}}{MAILSERVER_HOSTNAME}} \
- {eq {${lc:$sender_helo_name}}{MAILSERVER_IP}} \
- } {true}{false} }
+ # If the HELO pretend to be this host
+ deny condition = ${if or { \
+ {eq {${lc:$sender_helo_name}}{MAILSERVER_HOSTNAME}} \
+ {eq {${lc:$sender_helo_name}}{MAILSERVER_IP}} \
+ } {true}{false} }
# by default we accept
accept
@@ -182,9 +185,9 @@
warn message = X-SA-Report: $spam_report
spam = nobody:true
-
condition = ${if >{$spam_score_int}{0}{true}{false}}
- warn message = X-SA-Status: Yes
+
+ warn message = X-SA-Status: Yes
spam = nobody:true
condition = ${if >{$spam_score_int}{50}{true}{false}}
@@ -261,7 +264,7 @@
# allow_fail
# allow_defer
# data = ${lookup{$local_part}lsearch{/etc/aliases}}
-# user = exim
+# user = exim
# file_transport = address_file
# pipe_transport = address_pipe
@@ -347,14 +350,14 @@
transport = autoresponder_transport
unseen
-cc_router:
- driver = redirect
- data = ${lookup mysql {SELECT cc FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}')}{$value}}
- unseen
+# cc_router:
+# driver = redirect
+# data = ${lookup mysql {SELECT cc FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}')}{$value}}
+# unseen
-forward_router:
- driver = redirect
- data = ${lookup mysql {SELECT forward FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND forward != ''}{$value}}
+# forward_router:
+# driver = redirect
+# data = ${lookup mysql {SELECT forward FROM MYSQL_EMAILTABLE WHERE email=CONCAT('${quote_mysql:$local_part}','@','${quote_mysql:$domain}') AND forward != ''}{$value}}
local_mailbox_router:
driver = accept
diff --git a/interface/web/sites/mail_blacklist_edit.php b/interface/lib/classes/getconf.inc.php
similarity index 68%
copy from interface/web/sites/mail_blacklist_edit.php
copy to interface/lib/classes/getconf.inc.php
index e72f28c..fd0c088 100644
--- a/interface/web/sites/mail_blacklist_edit.php
+++ b/interface/lib/classes/getconf.inc.php
@@ -1,55 +1,60 @@
-<?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.
-*/
-
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/mail_blacklist.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"],$_SESSION["s"]["module"]["name"])) {
- header("Location: ../index.php");
- exit;
-}
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions');
-$app->tform_actions->onLoad();
-
-
+<?php
+
+/*
+Copyright (c) 2006, 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 getconf {
+
+ var $config;
+
+ function get_server_config($server_id, $section = '') {
+ global $app;
+
+ if(!is_array($this->config[$server_id])) {
+ $app->uses('ini_parser');
+ $server_id = intval($server_id);
+ $server = $app->db->queryOneRecord("SELECT config FROM server WHERE server_id = $server_id");
+ $this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server["config"]));
+ }
+
+ if($section == '') {
+ return $this->config[$server_id];
+ } else {
+ return $this->config[$server_id][$section];
+ }
+ }
+
+ function get_global_config() {
+
+ die("not yet implemented");
+
+ }
+
+}
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_blacklist_edit.php b/interface/lib/classes/ini_parser.inc.php
similarity index 63%
copy from interface/web/sites/mail_blacklist_edit.php
copy to interface/lib/classes/ini_parser.inc.php
index e72f28c..349990f 100644
--- a/interface/web/sites/mail_blacklist_edit.php
+++ b/interface/lib/classes/ini_parser.inc.php
@@ -1,55 +1,69 @@
-<?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.
-*/
-
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/mail_blacklist.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"],$_SESSION["s"]["module"]["name"])) {
- header("Location: ../index.php");
- exit;
-}
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions');
-$app->tform_actions->onLoad();
-
-
+<?php
+
+/*
+Copyright (c) 2006, 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 ini_parser {
+
+ var $config;
+
+ function parse_ini_string($ini) {
+ $ini = str_replace("\r\n","\n",$ini);
+ $lines = explode("\n",$ini);
+
+ foreach($lines as $line) {
+
+ if($line != '') {
+ $line = trim($line);
+ if(preg_match("/^\[([\w\d_]+)\]$/", $line, $matches)) {
+ $section = strtolower($matches[1]);
+ } elseif(preg_match("/^([\w\d_]+)=(.*)$/", $line, $matches) && $section != null) {
+ $item = trim($matches[1]);
+ $this->config[$section][$item] = trim($matches[2]);
+ }
+ }
+ }
+ return $this->config;
+ }
+
+
+
+ function get_ini_string($file) {
+ $content = '';
+ foreach($this->config as $section => $data) {
+ $content .= "[$section]\n";
+ foreach($data as $item => $value) {
+ if($value != '') $content .= "$item=$value\n";
+ }
+ }
+ return $content;
+ }
+
+}
+
?>
\ No newline at end of file
diff --git a/interface/lib/classes/listform.inc.php b/interface/lib/classes/listform.inc.php
index d7f1aec..e81a256 100644
--- a/interface/lib/classes/listform.inc.php
+++ b/interface/lib/classes/listform.inc.php
@@ -1,264 +1,328 @@
-<?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.
-*/
-
-/**
-* Listenbehandlung
-*
-* @package listform
-* @author Till Brehm
-* @version 1.1
-*/
-
-class listform {
-
- var $debug = 0;
- var $errorMessage;
- var $listDef;
- var $searchValues;
- var $pagingHTML;
- var $pagingValues;
- var $searchChanged = 0;
- var $module;
-
- function loadListDef($file,$module = '') {
- global $app,$conf;
- if(!is_file($file)) die("List-Definition: $file not found.");
- include_once($file);
- $this->listDef = $liste;
- $this->module = $module;
- return true;
- }
-
- function getSearchSQL($sql_where = "") {
- global $db;
-
- // Hole Config Variablen
- $list_name = $this->listDef["name"];
- $search_prefix = $this->listDef["search_prefix"];
-
- // speichere Suchanfrage
- foreach($this->listDef["item"] as $i) {
- $field = $i["field"];
-
- // hat sich die suche ge�ndert
- if(isset($_REQUEST[$search_prefix.$field]) and $_REQUEST[$search_prefix.$field] != $_SESSION["search"][$list_name][$search_prefix.$field]) $this->searchChanged = 1;
-
- // suchfeld in session speichern.
- if(isset($_REQUEST[$search_prefix.$field])) $_SESSION["search"][$list_name][$search_prefix.$field] = $_REQUEST[$search_prefix.$field];
-
- if($i["formtype"] == "SELECT") {
- if(is_array($i['value'])) {
- $out = '<option value=""></option>';
- foreach($i['value'] as $k => $v) {
- $selected = ($k == $_SESSION["search"][$list_name][$search_prefix.$field] && $_SESSION["search"][$list_name][$search_prefix.$field] != '')?' SELECTED':'';
- $out .= "<option value='$k'$selected>$v</option>\r\n";
- }
- }
- $this->searchValues[$search_prefix.$field] = $out;
- } else {
- $this->searchValues[$search_prefix.$field] = $_SESSION["search"][$list_name][$search_prefix.$field];
- }
- }
-
- // Speichere Variablen in Objekt zum sp�teren einparsen in Template
- // $this->searchValues = $_SESSION["search"][$list_name];
-
- foreach($this->listDef["item"] as $i) {
- $field = $i["field"];
- if($_REQUEST[$search_prefix.$field] != '') $sql_where .= " $field ".$i["op"]." '".$i["prefix"].$_REQUEST[$search_prefix.$field].$i["suffix"]."' and";
- }
-
- if($sql_where != '') {
- $sql_where = substr($sql_where,0,-3);
- } else {
- $sql_where = "1";
- }
-
-
- return $sql_where;
- }
-
- function getPagingSQL($sql_where = "1") {
- global $app, $conf;
-
- // Hole Config Variablen
- $list_name = $this->listDef["name"];
- $search_prefix = $this->listDef["search_prefix"];
- $records_per_page = $this->listDef["records_per_page"];
- $table = $this->listDef["table"];
-
- // setze page auf null, wenn in session nicht gesetzt
- if($_SESSION["search"][$list_name]["page"] == '') $_SESSION["search"][$list_name]["page"] = 0;
-
- // setze page auf wert der request variablen "page"
- if(isset($_REQUEST["page"])) $_SESSION["search"][$list_name]["page"] = $_REQUEST["page"];
-
- // page auf 0 setzen, wenn suche sich ge�ndert hat.
- if($this->searchChanged == 1) $_SESSION["search"][$list_name]["page"] = 0;
-
- $sql_von = $_SESSION["search"][$list_name]["page"] * $records_per_page;
- $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table WHERE $sql_where");
- $pages = intval($record_count["anzahl"] / $records_per_page);
-
-
- $vars["list_file"] = $this->listDef["file"];
- $vars["page"] = $_SESSION["search"][$list_name]["page"];
- $vars["last_page"] = $_SESSION["search"][$list_name]["page"] - 1;
- $vars["next_page"] = $_SESSION["search"][$list_name]["page"] + 1;
- $vars["pages"] = $pages;
- $vars["max_pages"] = $pages + 1;
- $vars["records_gesamt"] = $record_count["anzahl"];
- $vars["page_params"] = $this->listDef["page_params"];
-
-
- if($_SESSION["search"][$list_name]["page"] > 0) $vars["show_page_back"] = 1;
- if($_SESSION["search"][$list_name]["page"] <= $seiten - 1) $vars["show_page_next"] = 1;
-
- $this->pagingValues = $vars;
- $this->pagingHTML = $this->getPagingHTML($vars);
-
- $limit_sql = "LIMIT $sql_von, $records_per_page";
-
- return $limit_sql;
- }
-
- function getPagingHTML($vars) {
- global $app;
- $content = '[<a href="'.$vars["list_file"].'?page=0'.$vars["page_params"].'">|<< </a>]';
- if($vars["show_page_back"] == 1) $content .= '[<< <a href="'.$vars["list_file"].'?page='.$vars["last_page"].$vars["page_params"].'">'.$app->lng('Back').'</a>] ';
- $content .= ' '.$app->lng('Page').' '.$vars["next_page"].' '.$app->lng('of').' '.$vars["max_pages"].' ';
- if($vars["show_page_next"] == 1) $content .= '[<a href="'.$vars["list_file"].'?page='.$vars["next_page"].$vars["page_params"].'">'.$app->lng('Next').' >></a>] ';
- $content .= '[<a href="'.$vars["list_file"].'?page='.$vars["pages"].$vars["page_params"].'"> >>|</a>]';
-
- return $content;
- }
-
- function getSortSQL() {
- global $app, $conf;
-
- // Hole Config Variablen
- $sort_field = $this->listDef["sort_field"];
- $sort_direction = $this->listDef["sort_direction"];
-
- $sql_sort = '';
-
- if($sort_field != '' && $sort_direction != '') {
- $sql_sort = "ORDER BY $sort_field $sort_direction";
- }
-
- return $sql_sort;
- }
-
- function decode($record) {
- if(is_array($record)) {
- foreach($this->listDef["item"] as $field) {
- $key = $field["field"];
- switch ($field['datatype']) {
- case 'VARCHAR':
- $record[$key] = stripslashes($record[$key]);
- break;
-
- case 'TEXT':
- $record[$key] = stripslashes($record[$key]);
- break;
-
- case 'DATE':
- if($val > 0) {
- $record[$key] = date($this->dateformat,$record[$key]);
- }
- break;
-
- case 'INTEGER':
- $record[$key] = intval($record[$key]);
- break;
-
- case 'DOUBLE':
- $record[$key] = $record[$key];
- break;
-
- case 'CURRENCY':
- $record[$key] = number_format($record[$key], 2, ',', '');
- break;
-
- default:
- $record[$key] = stripslashes($record[$key]);
- }
- }
-
- }
- return $record;
- }
-
-
- function encode($record) {
-
- if(is_array($record)) {
- foreach($this->listDef["item"] as $field) {
- $key = $field["field"];
- switch ($field['datatype']) {
- case 'VARCHAR':
- if(!is_array($record[$key])) {
- $record[$key] = addslashes($record[$key]);
- } else {
- $record[$key] = implode($this->tableDef[$key]['separator'],$record[$key]);
- }
- break;
- case 'TEXT':
- if(!is_array($record[$key])) {
- $record[$key] = addslashes($record[$key]);
- } else {
- $record[$key] = implode($this->tableDef[$key]['separator'],$record[$key]);
- }
- break;
- case 'DATE':
- if($record[$key] > 0) {
- list($tag,$monat,$jahr) = explode('.',$record[$key]);
- $record[$key] = mktime(0,0,0,$monat,$tag,$jahr);
- }
- break;
- case 'INTEGER':
- $record[$key] = intval($record[$key]);
- break;
- case 'DOUBLE':
- $record[$key] = addslashes($record[$key]);
- break;
- case 'CURRENCY':
- $record[$key] = str_replace(",",".",$record[$key]);
- break;
- }
-
- }
- }
- return $record;
- }
-
-}
-
+<?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.
+*/
+
+/**
+* Listenbehandlung
+*
+* @package listform
+* @author Till Brehm
+* @version 1.1
+*/
+
+class listform {
+
+ var $debug = 0;
+ var $errorMessage;
+ var $listDef;
+ var $searchValues;
+ var $pagingHTML;
+ var $pagingValues;
+ var $searchChanged = 0;
+ var $module;
+
+ function loadListDef($file,$module = '') {
+ global $app,$conf;
+ if(!is_file($file)) die("List-Definition: $file not found.");
+ include_once($file);
+ $this->listDef = $liste;
+ $this->module = $module;
+
+ // Fill datasources
+ foreach($this->listDef["item"] as $key => $field) {
+ if(is_array($field['datasource'])) {
+ $this->listDef["item"][$key]["value"] = $this->getDatasourceData($field);
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Get the key => value array of a form filed from a datasource definitiom
+ *
+ * @param field = array with field definition
+ * @param record = Dataset as array
+ * @return key => value array for the value field of a form
+ */
+
+ function getDatasourceData($field) {
+ global $app;
+
+ $values = array();
+
+ if($field["datasource"]["type"] == 'SQL') {
+
+ // Preparing SQL string. We will replace some
+ // common placeholders
+ $querystring = $field["datasource"]["querystring"];
+ $querystring = str_replace("{USERID}",$_SESSION["s"]["user"]["userid"],$querystring);
+ $querystring = str_replace("{GROUPID}",$_SESSION["s"]["user"]["default_group"],$querystring);
+ $querystring = str_replace("{GROUPS}",$_SESSION["s"]["user"]["groups"],$querystring);
+ $table_idx = $this->formDef['db_table_idx'];
+ //$querystring = str_replace("{RECORDID}",$record[$table_idx],$querystring);
+ $app->uses("tform");
+ $querystring = str_replace("{AUTHSQL}",$app->tform->getAuthSQL('r'),$querystring);
+
+ // Getting the records
+ $tmp_records = $app->db->queryAllRecords($querystring);
+ if($app->db->errorMessage != '') die($app->db->errorMessage);
+ if(is_array($tmp_records)) {
+ $key_field = $field["datasource"]["keyfield"];
+ $value_field = $field["datasource"]["valuefield"];
+ foreach($tmp_records as $tmp_rec) {
+ $tmp_id = $tmp_rec[$key_field];
+ $values[$tmp_id] = $tmp_rec[$value_field];
+ }
+ }
+ }
+
+ if($field["datasource"]["type"] == 'CUSTOM') {
+ // Calls a custom class to validate this record
+ if($field["datasource"]['class'] != '' and $field["datasource"]['function'] != '') {
+ $datasource_class = $field["datasource"]['class'];
+ $datasource_function = $field["datasource"]['function'];
+ $app->uses($datasource_class);
+ $record = array();
+ $values = $app->$datasource_class->$datasource_function($field, $record);
+ } else {
+ $this->errorMessage .= "Custom datasource class or function is empty<br>\r\n";
+ }
+ }
+
+ return $values;
+
+ }
+
+ function getSearchSQL($sql_where = "") {
+ global $db;
+
+ // Hole Config Variablen
+ $list_name = $this->listDef["name"];
+ $search_prefix = $this->listDef["search_prefix"];
+
+ // speichere Suchanfrage
+ foreach($this->listDef["item"] as $i) {
+ $field = $i["field"];
+
+ // hat sich die suche ge�ndert
+ if(isset($_REQUEST[$search_prefix.$field]) and $_REQUEST[$search_prefix.$field] != $_SESSION["search"][$list_name][$search_prefix.$field]) $this->searchChanged = 1;
+
+ // suchfeld in session speichern.
+ if(isset($_REQUEST[$search_prefix.$field])) $_SESSION["search"][$list_name][$search_prefix.$field] = $_REQUEST[$search_prefix.$field];
+
+ if($i["formtype"] == "SELECT") {
+ if(is_array($i['value'])) {
+ $out = '<option value=""></option>';
+ foreach($i['value'] as $k => $v) {
+ $selected = ($k == $_SESSION["search"][$list_name][$search_prefix.$field] && $_SESSION["search"][$list_name][$search_prefix.$field] != '')?' SELECTED':'';
+ $out .= "<option value='$k'$selected>$v</option>\r\n";
+ }
+ }
+ $this->searchValues[$search_prefix.$field] = $out;
+ } else {
+ $this->searchValues[$search_prefix.$field] = $_SESSION["search"][$list_name][$search_prefix.$field];
+ }
+ }
+
+ // Speichere Variablen in Objekt zum sp�teren einparsen in Template
+ // $this->searchValues = $_SESSION["search"][$list_name];
+
+ foreach($this->listDef["item"] as $i) {
+ $field = $i["field"];
+ if($_REQUEST[$search_prefix.$field] != '') $sql_where .= " $field ".$i["op"]." '".$i["prefix"].$_REQUEST[$search_prefix.$field].$i["suffix"]."' and";
+ }
+
+ if($sql_where != '') {
+ $sql_where = substr($sql_where,0,-3);
+ } else {
+ $sql_where = "1";
+ }
+
+
+ return $sql_where;
+ }
+
+ function getPagingSQL($sql_where = "1") {
+ global $app, $conf;
+
+ // Hole Config Variablen
+ $list_name = $this->listDef["name"];
+ $search_prefix = $this->listDef["search_prefix"];
+ $records_per_page = $this->listDef["records_per_page"];
+ $table = $this->listDef["table"];
+
+ // setze page auf null, wenn in session nicht gesetzt
+ if($_SESSION["search"][$list_name]["page"] == '') $_SESSION["search"][$list_name]["page"] = 0;
+
+ // setze page auf wert der request variablen "page"
+ if(isset($_REQUEST["page"])) $_SESSION["search"][$list_name]["page"] = $_REQUEST["page"];
+
+ // page auf 0 setzen, wenn suche sich ge�ndert hat.
+ if($this->searchChanged == 1) $_SESSION["search"][$list_name]["page"] = 0;
+
+ $sql_von = $_SESSION["search"][$list_name]["page"] * $records_per_page;
+ $record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM $table WHERE $sql_where");
+ $pages = intval($record_count["anzahl"] / $records_per_page);
+
+
+ $vars["list_file"] = $this->listDef["file"];
+ $vars["page"] = $_SESSION["search"][$list_name]["page"];
+ $vars["last_page"] = $_SESSION["search"][$list_name]["page"] - 1;
+ $vars["next_page"] = $_SESSION["search"][$list_name]["page"] + 1;
+ $vars["pages"] = $pages;
+ $vars["max_pages"] = $pages + 1;
+ $vars["records_gesamt"] = $record_count["anzahl"];
+ $vars["page_params"] = $this->listDef["page_params"];
+
+
+ if($_SESSION["search"][$list_name]["page"] > 0) $vars["show_page_back"] = 1;
+ if($_SESSION["search"][$list_name]["page"] <= $seiten - 1) $vars["show_page_next"] = 1;
+
+ $this->pagingValues = $vars;
+ $this->pagingHTML = $this->getPagingHTML($vars);
+
+ $limit_sql = "LIMIT $sql_von, $records_per_page";
+
+ return $limit_sql;
+ }
+
+ function getPagingHTML($vars) {
+ global $app;
+ $content = '[<a href="'.$vars["list_file"].'?page=0'.$vars["page_params"].'">|<< </a>]';
+ if($vars["show_page_back"] == 1) $content .= '[<< <a href="'.$vars["list_file"].'?page='.$vars["last_page"].$vars["page_params"].'">'.$app->lng('Back').'</a>] ';
+ $content .= ' '.$app->lng('Page').' '.$vars["next_page"].' '.$app->lng('of').' '.$vars["max_pages"].' ';
+ if($vars["show_page_next"] == 1) $content .= '[<a href="'.$vars["list_file"].'?page='.$vars["next_page"].$vars["page_params"].'">'.$app->lng('Next').' >></a>] ';
+ $content .= '[<a href="'.$vars["list_file"].'?page='.$vars["pages"].$vars["page_params"].'"> >>|</a>]';
+
+ return $content;
+ }
+
+ function getSortSQL() {
+ global $app, $conf;
+
+ // Hole Config Variablen
+ $sort_field = $this->listDef["sort_field"];
+ $sort_direction = $this->listDef["sort_direction"];
+
+ $sql_sort = '';
+
+ if($sort_field != '' && $sort_direction != '') {
+ $sql_sort = "ORDER BY $sort_field $sort_direction";
+ }
+
+ return $sql_sort;
+ }
+
+ function decode($record) {
+ if(is_array($record)) {
+ foreach($this->listDef["item"] as $field) {
+ $key = $field["field"];
+ switch ($field['datatype']) {
+ case 'VARCHAR':
+ $record[$key] = stripslashes($record[$key]);
+ break;
+
+ case 'TEXT':
+ $record[$key] = stripslashes($record[$key]);
+ break;
+
+ case 'DATE':
+ if($val > 0) {
+ $record[$key] = date($this->dateformat,$record[$key]);
+ }
+ break;
+
+ case 'INTEGER':
+ $record[$key] = intval($record[$key]);
+ break;
+
+ case 'DOUBLE':
+ $record[$key] = $record[$key];
+ break;
+
+ case 'CURRENCY':
+ $record[$key] = number_format($record[$key], 2, ',', '');
+ break;
+
+ default:
+ $record[$key] = stripslashes($record[$key]);
+ }
+ }
+
+ }
+ return $record;
+ }
+
+
+ function encode($record) {
+
+ if(is_array($record)) {
+ foreach($this->listDef["item"] as $field) {
+ $key = $field["field"];
+ switch ($field['datatype']) {
+ case 'VARCHAR':
+ if(!is_array($record[$key])) {
+ $record[$key] = addslashes($record[$key]);
+ } else {
+ $record[$key] = implode($this->tableDef[$key]['separator'],$record[$key]);
+ }
+ break;
+ case 'TEXT':
+ if(!is_array($record[$key])) {
+ $record[$key] = addslashes($record[$key]);
+ } else {
+ $record[$key] = implode($this->tableDef[$key]['separator'],$record[$key]);
+ }
+ break;
+ case 'DATE':
+ if($record[$key] > 0) {
+ list($tag,$monat,$jahr) = explode('.',$record[$key]);
+ $record[$key] = mktime(0,0,0,$monat,$tag,$jahr);
+ }
+ break;
+ case 'INTEGER':
+ $record[$key] = intval($record[$key]);
+ break;
+ case 'DOUBLE':
+ $record[$key] = addslashes($record[$key]);
+ break;
+ case 'CURRENCY':
+ $record[$key] = str_replace(",",".",$record[$key]);
+ break;
+ }
+
+ }
+ }
+ return $record;
+ }
+
+}
+
?>
\ No newline at end of file
diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php
index 6a8d7bd..dd489c3 100644
--- a/interface/lib/classes/tform.inc.php
+++ b/interface/lib/classes/tform.inc.php
@@ -1,894 +1,894 @@
-<?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.
-*/
-
-/**
-* Formularbehandlung
-*
-* Funktionen zur Umwandlung von Formulardaten
-* sowie zum vorbereiten von HTML und SQL
-* Ausgaben
-*
-* Tabellendefinition
-*
-* Datentypen:
-* - INTEGER (Wandelt Ausdr�cke in Int um)
-* - DOUBLE
-* - CURRENCY (Formatiert Zahlen nach W�hrungsnotation)
-* - VARCHAR (kein weiterer Format Check)
-* - DATE (Datumsformat, Timestamp Umwandlung)
-*
-* Formtype:
-* - TEXT (normales Textfeld)
-* - PASSWORD (Feldinhalt wird nicht angezeigt)
-* - SELECT (Gibt Werte als option Feld aus)
-* - MULTIPLE (Select-Feld mit nehreren Werten)
-*
-* VALUE:
-* - Wert oder Array
-*
-* SEPARATOR
-* - Trennzeichen f�r multiple Felder
-*
-* Hinweis:
-* Das ID-Feld ist nicht bei den Table Values einzuf�gen.
-*
-* @package form
-* @author Till Brehm
-* @version 1.1
-*/
-
-class tform {
-
- /**
- * Definition der Tabelle (array)
- * @var tableDef
- */
- var $tableDef;
-
- /**
- * Private
- * @var action
- */
- var $action;
-
- /**
- * Tabellenname (String)
- * @var table_name
- */
- var $table_name;
-
- /**
- * Debug Variable
- * @var debug
- */
- var $debug = 0;
-
- /**
- * name des primary Field der Tabelle (string)
- * @var table_index
- */
- var $table_index;
-
- /**
- * enth�lt die Fehlermeldung bei �berpr�fung
- * der Variablen mit Regex
- * @var errorMessage
- */
- var $errorMessage = '';
-
- var $dateformat = "d.m.Y";
- var $formDef;
- var $wordbook;
- var $module;
- var $primary_id;
-
- /**
- * Laden der Tabellendefinition
- *
- * @param file: Pfad zur Tabellendefinition
- * @return true
- */
- /*
- function loadTableDef($file) {
- global $app,$conf;
-
- include_once($file);
- $this->tableDef = $table;
- $this->table_name = $table_name;
- $this->table_index = $table_index;
- return true;
- }
- */
-
- function loadFormDef($file,$module = '') {
- global $app,$conf;
-
- include_once($file);
- $this->formDef = $form;
-
- $this->module = $module;
- if($module == '') {
- include_once("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
- } else {
- include_once("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
- }
- $this->wordbook = $wb;
-
- return true;
- }
-
-
- /**
- * Konvertiert die Daten des �bergebenen assoziativen
- * Arrays in "menschenlesbare" Form.
- * Datentyp Konvertierung, z.B. f�r Ausgabe in Listen.
- *
- * @param record
- * @return record
- */
- function decode($record,$tab) {
- if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab).");
- if(is_array($record)) {
- foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
- switch ($field['datatype']) {
- case 'VARCHAR':
- $new_record[$key] = stripslashes($record[$key]);
- break;
-
- case 'TEXT':
- $new_record[$key] = stripslashes($record[$key]);
- break;
-
- case 'DATE':
- if($record[$key] > 0) {
- $new_record[$key] = date($this->dateformat,$record[$key]);
- }
- break;
-
- case 'INTEGER':
- $new_record[$key] = intval($record[$key]);
- break;
-
- case 'DOUBLE':
- $new_record[$key] = $record[$key];
- break;
-
- case 'CURRENCY':
- $new_record[$key] = number_format($record[$key], 2, ',', '');
- break;
-
- default:
- $new_record[$key] = stripslashes($record[$key]);
- }
- }
-
- }
- return $new_record;
- }
-
- /**
- * Get the key => value array of a form filed from a datasource definitiom
- *
- * @param field = NEW oder EDIT
- * @param record = Dataset as array
- * @return key => value array for the value field of a form
- */
-
- function getDatasourceData($field, $record) {
- global $app;
-
- $values = array();
-
- if($field["datasource"]["type"] == 'SQL') {
-
- // Preparing SQL string. We will replace some
- // common placeholders
- $querystring = $field["datasource"]["querystring"];
- $querystring = str_replace("{USERID}",$_SESSION["s"]["user"]["userid"],$querystring);
- $querystring = str_replace("{GROUPID}",$_SESSION["s"]["user"]["default_group"],$querystring);
- $querystring = str_replace("{GROUPS}",$_SESSION["s"]["user"]["groups"],$querystring);
- $table_idx = $this->formDef['db_table_idx'];
- $querystring = str_replace("{RECORDID}",$record[$table_idx],$querystring);
- $querystring = str_replace("{AUTHSQL}",$this->getAuthSQL('r'),$querystring);
-
- // Getting the records
- $tmp_records = $app->db->queryAllRecords($querystring);
- if($app->db->errorMessage != '') die($app->db->errorMessage);
- if(is_array($tmp_records)) {
- $key_field = $field["datasource"]["keyfield"];
- $value_field = $field["datasource"]["valuefield"];
- foreach($tmp_records as $tmp_rec) {
- $tmp_id = $tmp_rec[$key_field];
- $values[$tmp_id] = $tmp_rec[$value_field];
- }
- }
- }
-
- if($field["datasource"]["type"] == 'CUSTOM') {
- // Calls a custom class to validate this record
- if($field["datasource"]['class'] != '' and $field["datasource"]['function'] != '') {
- $datasource_class = $field["datasource"]['class'];
- $datasource_function = $field["datasource"]['function'];
- $app->uses($datasource_class);
- $values = $app->$datasource_class->$datasource_function($field, $record);
- } else {
- $this->errorMessage .= "Custom datasource class or function is empty<br>\r\n";
- }
- }
-
- return $values;
-
- }
-
-
- /**
- * Record f�r Ausgabe in Formularen vorbereiten.
- *
- * @param record = Datensatz als Array
- * @param action = NEW oder EDIT
- * @return record
- */
- function getHTML($record, $tab, $action = 'NEW') {
-
- global $app;
-
- $this->action = $action;
-
- if(!is_array($this->formDef)) $app->error("Keine Formdefinition vorhanden.");
- if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab).");
-
- $new_record = array();
- if($action == 'EDIT') {
- $record = $this->decode($record,$tab);
- if(is_array($record)) {
- foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
- $val = $record[$key];
-
- // If Datasource is set, get the data from there
- if(is_array($field['datasource'])) {
- $field["value"] = $this->getDatasourceData($field, $record);
- }
-
- switch ($field['formtype']) {
- case 'SELECT':
- if(is_array($field['value'])) {
- $out = '';
- foreach($field['value'] as $k => $v) {
- $selected = ($k == $val)?' SELECTED':'';
- $out .= "<option value='$k'$selected>$v</option>\r\n";
- }
- }
- $new_record[$key] = $out;
- break;
- case 'MULTIPLE':
- if(is_array($field['value'])) {
-
- // aufsplitten ergebnisse
- $vals = explode($field['separator'],$val);
-
- // HTML schreiben
- $out = '';
- foreach($field['value'] as $k => $v) {
-
- $selected = '';
- foreach($vals as $tvl) {
- if(trim($tvl) == trim($k)) $selected = ' SELECTED';
- }
-
- $out .= "<option value='$k'$selected>$v</option>\r\n";
- }
- }
- $new_record[$key] = $out;
- break;
-
- case 'PASSWORD':
- $new_record[$key] = '';
- break;
-
- case 'CHECKBOX':
- $checked = (empty($val))?'':' CHECKED';
- $new_record[$key] = "<input name=\"".$key."\" type=\"checkbox\" value=\"".$field['value']."\" $checked>\r\n";
- break;
-
- case 'CHECKBOXARRAY':
- if(is_array($field['value'])) {
-
- // aufsplitten ergebnisse
- $vals = explode($field['separator'],$val);
-
- // HTML schreiben
- $out = '';
- foreach($field['value'] as $k => $v) {
-
- $checked = '';
- foreach($vals as $tvl) {
- if(trim($tvl) == trim($k)) $checked = ' CHECKED';
- }
-
- $out .= "<input name=\"".$key."[]\" type=\"checkbox\" value=\"$k\" $checked>$v <br />\r\n";
- }
- }
- $new_record[$key] = $out;
- break;
-
- case 'RADIO':
- if(is_array($field['value'])) {
-
- // HTML schreiben
- $out = '';
- foreach($field['value'] as $k => $v) {
- $checked = ($k == $val)?' CHECKED':'';
- $out .= "<input name='".$key."[]' type='radio' value='$k'$checked> $v<br>\r\n";
- }
- }
- $new_record[$key] = $out;
- break;
-
- default:
- $new_record[$key] = htmlspecialchars($record[$key]);
- }
- }
- }
- } else {
- // Action: NEW
- foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
-
- // If Datasource is set, get the data from there
- if(is_array($field['datasource'])) {
- $field["value"] = $this->getDatasourceData($field, $record);
- }
-
- switch ($field['formtype']) {
- case 'SELECT':
- if(is_array($field['value'])) {
- $out = '';
- foreach($field['value'] as $k => $v) {
- $selected = ($k == $val)?' SELECTED':'';
- $out .= "<option value='$k'$selected>$v</option>\r\n";
- }
- }
- $new_record[$key] = $out;
- break;
- case 'MULTIPLE':
- if(is_array($field['value'])) {
-
- // aufsplitten ergebnisse
- $vals = explode($field['separator'],$val);
-
- // HTML schreiben
- $out = '';
- foreach($field['value'] as $k => $v) {
-
- $out .= "<option value='$k'>$v</option>\r\n";
- }
- }
- $new_record[$key] = $out;
- break;
-
- case 'PASSWORD':
- $new_record[$key] = '';
- break;
-
- case 'CHECKBOX':
- $checked = (empty($field["default"]))?'':' CHECKED';
- $new_record[$key] = "<input name=\"".$key."\" type=\"checkbox\" value=\"".$field['value']."\" $checked>\r\n";
- break;
-
- case 'CHECKBOXARRAY':
- if(is_array($field['value'])) {
-
- // aufsplitten ergebnisse
- $vals = explode($field['separator'],$field["default"]);
-
- // HTML schreiben
- $out = '';
- foreach($field['value'] as $k => $v) {
-
- $checked = '';
- foreach($vals as $tvl) {
- if(trim($tvl) == trim($k)) $checked = ' CHECKED';
- }
-
- $out .= "<input name=\"".$key."[]\" type=\"checkbox\" value=\"$k\" $checked> $v<br />\r\n";
- }
- }
- $new_record[$key] = $out;
- break;
-
- case 'RADIO':
- if(is_array($field['value'])) {
-
- // HTML schreiben
- $out = '';
- foreach($field['value'] as $k => $v) {
- $checked = ($k == $field["default"])?' CHECKED':'';
- $out .= "<input name='".$key."[]' type='radio' value='$k'$checked> $v<br>\r\n";
- }
- }
- $new_record[$key] = $out;
- break;
-
- default:
- $new_record[$key] = htmlspecialchars($field['default']);
- }
- }
-
- }
-
- if($this->debug == 1) $this->dbg($new_record);
-
- return $new_record;
- }
-
- /**
- * Record in "maschinen lesbares" Format �berf�hren
- * und Werte gegen regul�re Ausdr�cke pr�fen.
- *
- * @param record = Datensatz als Array
- * @return record
- */
- function encode($record,$tab) {
-
- if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab).");
- //$this->errorMessage = '';
-
- if(is_array($record)) {
- foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
-
- if(is_array($field['validators'])) $this->validateField($key, $record[$key], $field['validators']);
-
- switch ($field['datatype']) {
- case 'VARCHAR':
- if(!is_array($record[$key])) {
- $new_record[$key] = addslashes($record[$key]);
- } else {
- $new_record[$key] = implode($field['separator'],$record[$key]);
- }
- break;
- case 'TEXT':
- if(!is_array($record[$key])) {
- $new_record[$key] = addslashes($record[$key]);
- } else {
- $new_record[$key] = implode($field['separator'],$record[$key]);
- }
- break;
- case 'DATE':
- if($record[$key] > 0) {
- list($tag,$monat,$jahr) = explode('.',$record[$key]);
- $new_record[$key] = mktime(0,0,0,$monat,$tag,$jahr);
- }
- break;
- case 'INTEGER':
- $new_record[$key] = intval($record[$key]);
- //if($new_record[$key] != $record[$key]) $new_record[$key] = $field['default'];
- //if($key == 'refresh') die($record[$key]);
- break;
- case 'DOUBLE':
- $new_record[$key] = addslashes($record[$key]);
- break;
- case 'CURRENCY':
- $new_record[$key] = str_replace(",",".",$record[$key]);
- break;
- }
-
- // The use of the field value is deprecated, use validators instead
- if($field['regex'] != '') {
- // Enable that "." matches also newlines
- $field['regex'] .= 's';
- if(!preg_match($field['regex'], $record[$key])) {
- $errmsg = $field['errmsg'];
- $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
- }
- }
-
-
- }
- }
- return $new_record;
- }
-
- /**
- * process the validators for a given field.
- *
- * @param field_name = Name of the field
- * @param field_value = value of the field
- * @param validatoors = Array of validators
- * @return record
- */
-
- function validateField($field_name, $field_value, $validators) {
-
- global $app;
-
- // loop trough the validators
- foreach($validators as $validator) {
-
- switch ($validator['type']) {
- case 'REGEX':
- $validator['regex'] .= 's';
- if(!preg_match($validator['regex'], $field_value)) {
- $errmsg = $validator['errmsg'];
- $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
- }
- break;
- case 'UNIQUE':
- if($this->action == 'NEW') {
- $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."'");
- if($num_rec["number"] > 0) {
- $errmsg = $validator['errmsg'];
- $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
- }
- } else {
- $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."' AND ".$this->formDef['db_table_idx']." != ".$this->primary_id);
- if($num_rec["number"] > 0) {
- $errmsg = $validator['errmsg'];
- $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
- }
- }
- break;
- case 'NOTEMPTY':
- if(empty($field_value)) {
- $errmsg = $validator['errmsg'];
- $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
- }
- break;
- case 'ISEMAIL':
- if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{2,4}$/i", $field_value)) {
- $errmsg = $validator['errmsg'];
- $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
- }
- break;
- case 'ISINT':
- $tmpval = intval($field_value);
- if($tmpval === 0 and !empty($field_value)) {
- $errmsg = $validator['errmsg'];
- $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
- }
- break;
- case 'ISPOSITIVE':
- if(!is_numeric($field_value) || $field_value <= 0){
- $errmsg = $validator['errmsg'];
- $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
- }
- break;
- case 'CUSTOM':
- // Calls a custom class to validate this record
- if($validator['class'] != '' and $validator['function'] != '') {
- $validator_class = $validator['class'];
- $validator_function = $validator['function'];
- $app->uses($validator_class);
- $this->errorMessage .= $app->$validator_class->$validator_function($validator);
- } else {
- $this->errorMessage .= "Custom validator class or function is empty<br>\r\n";
- }
- break;
- }
-
-
- }
-
- return true;
- }
-
- /**
- * SQL Statement f�r Record erzeugen.
- *
- * @param record = Datensatz als Array
- * @param action = INSERT oder UPDATE
- * @param primary_id
- * @return record
- */
- function getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_where = '') {
-
- global $app;
-
- // If there are no data records on the tab, return empty sql string
- if(count($this->formDef['tabs'][$tab]['fields']) == 0) return '';
-
- // checking permissions
- if($this->formDef['auth'] == 'yes') {
- if($action == "INSERT") {
- if(!$this->checkPerm($primary_id,'i')) $this->errorMessage .= "Insert denied.<br>\r\n";
- } else {
- if(!$this->checkPerm($primary_id,'u')) $this->errorMessage .= "Insert denied.<br>\r\n";
- }
- }
-
- $this->action = $action;
- $this->primary_id = $primary_id;
-
- $record = $this->encode($record,$tab);
- $sql_insert_key = '';
- $sql_insert_val = '';
- $sql_update = '';
-
- if(!is_array($this->formDef)) $app->error("Keine Formulardefinition vorhanden.");
- if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab).");
-
- // gehe durch alle Felder des Tabs
- if(is_array($record)) {
- foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
- // Wenn es kein leeres Passwortfeld ist
- if (!($field['formtype'] == 'PASSWORD' and $record[$key] == '')) {
- // Erzeuge Insert oder Update Quelltext
- if($action == "INSERT") {
- if($field['formtype'] == 'PASSWORD') {
- $sql_insert_key .= "`$key`, ";
- if($field['encryption'] == 'CRYPT') {
- $sql_insert_val .= "'".crypt($record[$key])."', ";
- } else {
- $sql_insert_val .= "md5('".$record[$key]."'), ";
- }
- } else {
- $sql_insert_key .= "`$key`, ";
- $sql_insert_val .= "'".$record[$key]."', ";
- }
- } else {
- if($field['formtype'] == 'PASSWORD') {
- if($field['encryption'] == 'CRYPT') {
- $sql_update .= "`$key` = '".crypt($record[$key])."', ";
- } else {
- $sql_update .= "`$key` = md5('".$record[$key]."'), ";
- }
- } else {
- $sql_update .= "`$key` = '".$record[$key]."', ";
- }
- }
- }
- }
- }
-
-
- // F�ge Backticks nur bei unvollst�ndigen Tabellennamen ein
- if(stristr($this->formDef['db_table'],'.')) {
- $escape = '';
- } else {
- $escape = '`';
- }
-
-
- if($action == "INSERT") {
- if($this->formDef['auth'] == 'yes') {
- // Setze User und Gruppe
- $sql_insert_key .= "`sys_userid`, ";
- $sql_insert_val .= ($this->formDef["auth_preset"]["userid"] > 0)?"'".$this->formDef["auth_preset"]["userid"]."', ":"'".$_SESSION["s"]["user"]["userid"]."', ";
- $sql_insert_key .= "`sys_groupid`, ";
- $sql_insert_val .= ($this->formDef["auth_preset"]["groupid"] > 0)?"'".$this->formDef["auth_preset"]["groupid"]."', ":"'".$_SESSION["s"]["user"]["default_group"]."', ";
- $sql_insert_key .= "`sys_perm_user`, ";
- $sql_insert_val .= "'".$this->formDef["auth_preset"]["perm_user"]."', ";
- $sql_insert_key .= "`sys_perm_group`, ";
- $sql_insert_val .= "'".$this->formDef["auth_preset"]["perm_group"]."', ";
- $sql_insert_key .= "`sys_perm_other`, ";
- $sql_insert_val .= "'".$this->formDef["auth_preset"]["perm_other"]."', ";
- }
- $sql_insert_key = substr($sql_insert_key,0,-2);
- $sql_insert_val = substr($sql_insert_val,0,-2);
- $sql = "INSERT INTO ".$escape.$this->formDef['db_table'].$escape." ($sql_insert_key) VALUES ($sql_insert_val)";
- } 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;
- if($sql_ext_where != '') $sql .= " and ".$sql_ext_where;
- } else {
- $app->error("Primary ID fehlt!");
- }
- }
-
- // Daten in History tabelle speichern
- if($this->errorMessage == '' and $this->formDef['db_history'] == 'yes') $this->datalogSave($action,$primary_id,$record);
-
- return $sql;
- }
-
- /**
- * Debugging arrays.
- *
- * @param array_data
- */
- function dbg($array_data) {
-
- echo "<pre>";
- print_r($array_data);
- echo "</pre>";
-
- }
-
-
- function showForm() {
- global $app,$conf;
-
- if(!is_array($this->formDef)) die("Form Definition wurde nicht geladen.");
-
- $active_tab = $this->getNextTab();
-
- // definiere Tabs
- foreach( $this->formDef["tabs"] as $key => $tab) {
-
- $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"];
-
- // �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"]);
- $tab["active"] = 1;
- $_SESSION["s"]["form"]["tab"] = $tab['name'];
- } else {
- $tab["active"] = 0;
- }
-
- // Die Datenfelder werden f�r die Tabs nicht ben�tigt
- unset($tab["fields"]);
- unset($tab["plugins"]);
-
- $frmTab[] = $tab;
- }
-
- // setting form tabs
- $app->tpl->setLoop("formTab", $frmTab);
-
- // Set form action
- $app->tpl->setVar('form_action',$this->formDef["action"]);
- $app->tpl->setVar('form_active_tab',$active_tab);
-
- // Set form title
- $form_hint = '<b>'.$this->formDef["title"].'</b>';
- if($this->formDef["description"] != '') $form_hint .= '<br><br>'.$this->formDef["description"];
- $app->tpl->setVar('form_hint',$form_hint);
-
- // Set Wordbook for this form
-
- $app->tpl->setVar($this->wordbook);
- }
-
-
-
- function datalogSave($action,$primary_id,$record_new) {
- global $app,$conf;
-
- // F�ge Backticks nur bei unvollst�ndigen Tabellennamen ein
- if(stristr($this->formDef['db_table'],'.')) {
- $escape = '';
- } else {
- $escape = '`';
- }
-
- if($action == "UPDATE") {
- $sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id;
- $record_old = $app->db->queryOneRecord($sql);
- } else {
- $record_old = array();
- }
-
- $diffrec = array();
-
- if(is_array($record_new)) {
- foreach($record_new as $key => $val) {
- if($record_old[$key] != $val) {
- // Datensatz hat sich ge�ndert
- $diffrec[$key] = array('old' => $record_old[$key],
- 'new' => $val);
- }
- }
- }
-
- if(count($diffrec) > 0) {
- $diffstr = $app->db->quote(serialize($diffrec));
- $username = $app->db->quote($_SESSION["s"]["user"]["username"]);
- $dbidx = $this->formDef['db_table_idx'].":".$primary_id;
- $action = ($action == 'INSERT')?'i':'u';
- $sql = "INSERT INTO sys_datalog (dbtable,dbidx,action,tstamp,user,data) VALUES ('".$this->formDef['db_table']."','$dbidx','$action','".time()."','$username','$diffstr')";
- $app->db->query($sql);
- }
-
- return true;
-
- }
-
- function getAuthSQL($perm) {
-
- $sql = '(';
- $sql .= "(sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND sys_perm_user like '%$perm%') OR ";
- $sql .= "(sys_groupid IN (".$_SESSION["s"]["user"]["groups"].") AND sys_perm_group like '%$perm%') OR ";
- $sql .= "sys_perm_other like '%$perm%'";
- $sql .= ')';
-
- return $sql;
- }
-
- /*
- Diese funktion �berpr�ft, ob ein User die Berechtigung $perm f�r den Datensatz mit der ID $record_id
- hat. It record_id = 0, dann wird gegen die user Defaults des Formulares getestet.
- */
- function checkPerm($record_id,$perm) {
- global $app;
-
- if($record_id > 0) {
- // F�ge Backticks nur bei unvollst�ndigen Tabellennamen ein
- if(stristr($this->formDef['db_table'],'.')) {
- $escape = '';
- } else {
- $escape = '`';
- }
-
- $sql = "SELECT ".$this->formDef['db_table_idx']." FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$record_id." AND ".$this->getAuthSQL($perm);
- if($record = $app->db->queryOneRecord($sql)) {
- return true;
- } else {
- return false;
- }
- } else {
- $result = false;
- if($this->formDef["auth_preset"]["userid"] == $_SESSION["s"]["user"]["userid"] && stristr($perm,$this->formDef["auth_preset"]["perm_user"])) $result = true;
- if($this->formDef["auth_preset"]["groupid"] == $_SESSION["s"]["user"]["groupid"] && stristr($perm,$this->formDef["auth_preset"]["perm_group"])) $result = true;
- if(@stristr($this->formDef["auth_preset"]["perm_other"],$perm)) $result = true;
-
- // if preset == 0, everyone can insert a record of this type
- if($this->formDef["auth_preset"]["userid"] == 0 AND $this->formDef["auth_preset"]["groupid"] == 0 AND (@stristr($this->formDef["auth_preset"]["perm_user"],$perm) OR @stristr($this->formDef["auth_preset"]["perm_group"],$perm))) $result = true;
-
- return $result;
-
- }
-
- }
-
- function getNextTab() {
- // Welcher Tab wird angezeigt
- if($this->errorMessage == '') {
- // wenn kein Fehler vorliegt
- if($_REQUEST["next_tab"] != '') {
- // wenn n�chster Tab bekannt
- $active_tab = $_REQUEST["next_tab"];
- } else {
- // ansonsten ersten tab nehmen
- $active_tab = $this->formDef['tab_default'];
- }
- } else {
- // bei Fehlern den gleichen Tab nochmal anzeigen
- $active_tab = $_SESSION["s"]["form"]["tab"];
- }
-
- return $active_tab;
- }
-
- function getCurrentTab() {
- return $_SESSION["s"]["form"]["tab"];
- }
-
-}
-
+<?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.
+*/
+
+/**
+* Formularbehandlung
+*
+* Funktionen zur Umwandlung von Formulardaten
+* sowie zum vorbereiten von HTML und SQL
+* Ausgaben
+*
+* Tabellendefinition
+*
+* Datentypen:
+* - INTEGER (Wandelt Ausdr�cke in Int um)
+* - DOUBLE
+* - CURRENCY (Formatiert Zahlen nach W�hrungsnotation)
+* - VARCHAR (kein weiterer Format Check)
+* - DATE (Datumsformat, Timestamp Umwandlung)
+*
+* Formtype:
+* - TEXT (normales Textfeld)
+* - PASSWORD (Feldinhalt wird nicht angezeigt)
+* - SELECT (Gibt Werte als option Feld aus)
+* - MULTIPLE (Select-Feld mit nehreren Werten)
+*
+* VALUE:
+* - Wert oder Array
+*
+* SEPARATOR
+* - Trennzeichen f�r multiple Felder
+*
+* Hinweis:
+* Das ID-Feld ist nicht bei den Table Values einzuf�gen.
+*
+* @package form
+* @author Till Brehm
+* @version 1.1
+*/
+
+class tform {
+
+ /**
+ * Definition der Tabelle (array)
+ * @var tableDef
+ */
+ var $tableDef;
+
+ /**
+ * Private
+ * @var action
+ */
+ var $action;
+
+ /**
+ * Tabellenname (String)
+ * @var table_name
+ */
+ var $table_name;
+
+ /**
+ * Debug Variable
+ * @var debug
+ */
+ var $debug = 0;
+
+ /**
+ * name des primary Field der Tabelle (string)
+ * @var table_index
+ */
+ var $table_index;
+
+ /**
+ * enth�lt die Fehlermeldung bei �berpr�fung
+ * der Variablen mit Regex
+ * @var errorMessage
+ */
+ var $errorMessage = '';
+
+ var $dateformat = "d.m.Y";
+ var $formDef;
+ var $wordbook;
+ var $module;
+ var $primary_id;
+
+ /**
+ * Laden der Tabellendefinition
+ *
+ * @param file: Pfad zur Tabellendefinition
+ * @return true
+ */
+ /*
+ function loadTableDef($file) {
+ global $app,$conf;
+
+ include_once($file);
+ $this->tableDef = $table;
+ $this->table_name = $table_name;
+ $this->table_index = $table_index;
+ return true;
+ }
+ */
+
+ function loadFormDef($file,$module = '') {
+ global $app,$conf;
+
+ include_once($file);
+ $this->formDef = $form;
+
+ $this->module = $module;
+ if($module == '') {
+ include_once("lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
+ } else {
+ include_once("../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng");
+ }
+ $this->wordbook = $wb;
+
+ return true;
+ }
+
+
+ /**
+ * Konvertiert die Daten des �bergebenen assoziativen
+ * Arrays in "menschenlesbare" Form.
+ * Datentyp Konvertierung, z.B. f�r Ausgabe in Listen.
+ *
+ * @param record
+ * @return record
+ */
+ function decode($record,$tab) {
+ if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab).");
+ if(is_array($record)) {
+ foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
+ switch ($field['datatype']) {
+ case 'VARCHAR':
+ $new_record[$key] = stripslashes($record[$key]);
+ break;
+
+ case 'TEXT':
+ $new_record[$key] = stripslashes($record[$key]);
+ break;
+
+ case 'DATE':
+ if($record[$key] > 0) {
+ $new_record[$key] = date($this->dateformat,$record[$key]);
+ }
+ break;
+
+ case 'INTEGER':
+ $new_record[$key] = intval($record[$key]);
+ break;
+
+ case 'DOUBLE':
+ $new_record[$key] = $record[$key];
+ break;
+
+ case 'CURRENCY':
+ $new_record[$key] = number_format($record[$key], 2, ',', '');
+ break;
+
+ default:
+ $new_record[$key] = stripslashes($record[$key]);
+ }
+ }
+
+ }
+ return $new_record;
+ }
+
+ /**
+ * Get the key => value array of a form filed from a datasource definitiom
+ *
+ * @param field = array with field definition
+ * @param record = Dataset as array
+ * @return key => value array for the value field of a form
+ */
+
+ function getDatasourceData($field, $record) {
+ global $app;
+
+ $values = array();
+
+ if($field["datasource"]["type"] == 'SQL') {
+
+ // Preparing SQL string. We will replace some
+ // common placeholders
+ $querystring = $field["datasource"]["querystring"];
+ $querystring = str_replace("{USERID}",$_SESSION["s"]["user"]["userid"],$querystring);
+ $querystring = str_replace("{GROUPID}",$_SESSION["s"]["user"]["default_group"],$querystring);
+ $querystring = str_replace("{GROUPS}",$_SESSION["s"]["user"]["groups"],$querystring);
+ $table_idx = $this->formDef['db_table_idx'];
+ $querystring = str_replace("{RECORDID}",$record[$table_idx],$querystring);
+ $querystring = str_replace("{AUTHSQL}",$this->getAuthSQL('r'),$querystring);
+
+ // Getting the records
+ $tmp_records = $app->db->queryAllRecords($querystring);
+ if($app->db->errorMessage != '') die($app->db->errorMessage);
+ if(is_array($tmp_records)) {
+ $key_field = $field["datasource"]["keyfield"];
+ $value_field = $field["datasource"]["valuefield"];
+ foreach($tmp_records as $tmp_rec) {
+ $tmp_id = $tmp_rec[$key_field];
+ $values[$tmp_id] = $tmp_rec[$value_field];
+ }
+ }
+ }
+
+ if($field["datasource"]["type"] == 'CUSTOM') {
+ // Calls a custom class to validate this record
+ if($field["datasource"]['class'] != '' and $field["datasource"]['function'] != '') {
+ $datasource_class = $field["datasource"]['class'];
+ $datasource_function = $field["datasource"]['function'];
+ $app->uses($datasource_class);
+ $values = $app->$datasource_class->$datasource_function($field, $record);
+ } else {
+ $this->errorMessage .= "Custom datasource class or function is empty<br>\r\n";
+ }
+ }
+
+ return $values;
+
+ }
+
+
+ /**
+ * Record f�r Ausgabe in Formularen vorbereiten.
+ *
+ * @param record = Datensatz als Array
+ * @param action = NEW oder EDIT
+ * @return record
+ */
+ function getHTML($record, $tab, $action = 'NEW') {
+
+ global $app;
+
+ $this->action = $action;
+
+ if(!is_array($this->formDef)) $app->error("Keine Formdefinition vorhanden.");
+ if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab).");
+
+ $new_record = array();
+ if($action == 'EDIT') {
+ $record = $this->decode($record,$tab);
+ if(is_array($record)) {
+ foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
+ $val = $record[$key];
+
+ // If Datasource is set, get the data from there
+ if(is_array($field['datasource'])) {
+ $field["value"] = $this->getDatasourceData($field, $record);
+ }
+
+ switch ($field['formtype']) {
+ case 'SELECT':
+ if(is_array($field['value'])) {
+ $out = '';
+ foreach($field['value'] as $k => $v) {
+ $selected = ($k == $val)?' SELECTED':'';
+ $out .= "<option value='$k'$selected>$v</option>\r\n";
+ }
+ }
+ $new_record[$key] = $out;
+ break;
+ case 'MULTIPLE':
+ if(is_array($field['value'])) {
+
+ // aufsplitten ergebnisse
+ $vals = explode($field['separator'],$val);
+
+ // HTML schreiben
+ $out = '';
+ foreach($field['value'] as $k => $v) {
+
+ $selected = '';
+ foreach($vals as $tvl) {
+ if(trim($tvl) == trim($k)) $selected = ' SELECTED';
+ }
+
+ $out .= "<option value='$k'$selected>$v</option>\r\n";
+ }
+ }
+ $new_record[$key] = $out;
+ break;
+
+ case 'PASSWORD':
+ $new_record[$key] = '';
+ break;
+
+ case 'CHECKBOX':
+ $checked = (empty($val))?'':' CHECKED';
+ $new_record[$key] = "<input name=\"".$key."\" type=\"checkbox\" value=\"".$field['value']."\" $checked>\r\n";
+ break;
+
+ case 'CHECKBOXARRAY':
+ if(is_array($field['value'])) {
+
+ // aufsplitten ergebnisse
+ $vals = explode($field['separator'],$val);
+
+ // HTML schreiben
+ $out = '';
+ foreach($field['value'] as $k => $v) {
+
+ $checked = '';
+ foreach($vals as $tvl) {
+ if(trim($tvl) == trim($k)) $checked = ' CHECKED';
+ }
+
+ $out .= "<input name=\"".$key."[]\" type=\"checkbox\" value=\"$k\" $checked>$v <br />\r\n";
+ }
+ }
+ $new_record[$key] = $out;
+ break;
+
+ case 'RADIO':
+ if(is_array($field['value'])) {
+
+ // HTML schreiben
+ $out = '';
+ foreach($field['value'] as $k => $v) {
+ $checked = ($k == $val)?' CHECKED':'';
+ $out .= "<input name='".$key."[]' type='radio' value='$k'$checked> $v<br>\r\n";
+ }
+ }
+ $new_record[$key] = $out;
+ break;
+
+ default:
+ $new_record[$key] = htmlspecialchars($record[$key]);
+ }
+ }
+ }
+ } else {
+ // Action: NEW
+ foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
+
+ // If Datasource is set, get the data from there
+ if(is_array($field['datasource'])) {
+ $field["value"] = $this->getDatasourceData($field, $record);
+ }
+
+ switch ($field['formtype']) {
+ case 'SELECT':
+ if(is_array($field['value'])) {
+ $out = '';
+ foreach($field['value'] as $k => $v) {
+ $selected = ($k == $val)?' SELECTED':'';
+ $out .= "<option value='$k'$selected>$v</option>\r\n";
+ }
+ }
+ $new_record[$key] = $out;
+ break;
+ case 'MULTIPLE':
+ if(is_array($field['value'])) {
+
+ // aufsplitten ergebnisse
+ $vals = explode($field['separator'],$val);
+
+ // HTML schreiben
+ $out = '';
+ foreach($field['value'] as $k => $v) {
+
+ $out .= "<option value='$k'>$v</option>\r\n";
+ }
+ }
+ $new_record[$key] = $out;
+ break;
+
+ case 'PASSWORD':
+ $new_record[$key] = '';
+ break;
+
+ case 'CHECKBOX':
+ $checked = (empty($field["default"]))?'':' CHECKED';
+ $new_record[$key] = "<input name=\"".$key."\" type=\"checkbox\" value=\"".$field['value']."\" $checked>\r\n";
+ break;
+
+ case 'CHECKBOXARRAY':
+ if(is_array($field['value'])) {
+
+ // aufsplitten ergebnisse
+ $vals = explode($field['separator'],$field["default"]);
+
+ // HTML schreiben
+ $out = '';
+ foreach($field['value'] as $k => $v) {
+
+ $checked = '';
+ foreach($vals as $tvl) {
+ if(trim($tvl) == trim($k)) $checked = ' CHECKED';
+ }
+
+ $out .= "<input name=\"".$key."[]\" type=\"checkbox\" value=\"$k\" $checked> $v<br />\r\n";
+ }
+ }
+ $new_record[$key] = $out;
+ break;
+
+ case 'RADIO':
+ if(is_array($field['value'])) {
+
+ // HTML schreiben
+ $out = '';
+ foreach($field['value'] as $k => $v) {
+ $checked = ($k == $field["default"])?' CHECKED':'';
+ $out .= "<input name='".$key."[]' type='radio' value='$k'$checked> $v<br>\r\n";
+ }
+ }
+ $new_record[$key] = $out;
+ break;
+
+ default:
+ $new_record[$key] = htmlspecialchars($field['default']);
+ }
+ }
+
+ }
+
+ if($this->debug == 1) $this->dbg($new_record);
+
+ return $new_record;
+ }
+
+ /**
+ * Record in "maschinen lesbares" Format �berf�hren
+ * und Werte gegen regul�re Ausdr�cke pr�fen.
+ *
+ * @param record = Datensatz als Array
+ * @return record
+ */
+ function encode($record,$tab) {
+
+ if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab).");
+ //$this->errorMessage = '';
+
+ if(is_array($record)) {
+ foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
+
+ if(is_array($field['validators'])) $this->validateField($key, $record[$key], $field['validators']);
+
+ switch ($field['datatype']) {
+ case 'VARCHAR':
+ if(!is_array($record[$key])) {
+ $new_record[$key] = addslashes($record[$key]);
+ } else {
+ $new_record[$key] = implode($field['separator'],$record[$key]);
+ }
+ break;
+ case 'TEXT':
+ if(!is_array($record[$key])) {
+ $new_record[$key] = addslashes($record[$key]);
+ } else {
+ $new_record[$key] = implode($field['separator'],$record[$key]);
+ }
+ break;
+ case 'DATE':
+ if($record[$key] > 0) {
+ list($tag,$monat,$jahr) = explode('.',$record[$key]);
+ $new_record[$key] = mktime(0,0,0,$monat,$tag,$jahr);
+ }
+ break;
+ case 'INTEGER':
+ $new_record[$key] = intval($record[$key]);
+ //if($new_record[$key] != $record[$key]) $new_record[$key] = $field['default'];
+ //if($key == 'refresh') die($record[$key]);
+ break;
+ case 'DOUBLE':
+ $new_record[$key] = addslashes($record[$key]);
+ break;
+ case 'CURRENCY':
+ $new_record[$key] = str_replace(",",".",$record[$key]);
+ break;
+ }
+
+ // The use of the field value is deprecated, use validators instead
+ if($field['regex'] != '') {
+ // Enable that "." matches also newlines
+ $field['regex'] .= 's';
+ if(!preg_match($field['regex'], $record[$key])) {
+ $errmsg = $field['errmsg'];
+ $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
+ }
+ }
+
+
+ }
+ }
+ return $new_record;
+ }
+
+ /**
+ * process the validators for a given field.
+ *
+ * @param field_name = Name of the field
+ * @param field_value = value of the field
+ * @param validatoors = Array of validators
+ * @return record
+ */
+
+ function validateField($field_name, $field_value, $validators) {
+
+ global $app;
+
+ // loop trough the validators
+ foreach($validators as $validator) {
+
+ switch ($validator['type']) {
+ case 'REGEX':
+ $validator['regex'] .= 's';
+ if(!preg_match($validator['regex'], $field_value)) {
+ $errmsg = $validator['errmsg'];
+ $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
+ }
+ break;
+ case 'UNIQUE':
+ if($this->action == 'NEW') {
+ $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."'");
+ if($num_rec["number"] > 0) {
+ $errmsg = $validator['errmsg'];
+ $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
+ }
+ } else {
+ $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."' AND ".$this->formDef['db_table_idx']." != ".$this->primary_id);
+ if($num_rec["number"] > 0) {
+ $errmsg = $validator['errmsg'];
+ $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
+ }
+ }
+ break;
+ case 'NOTEMPTY':
+ if(empty($field_value)) {
+ $errmsg = $validator['errmsg'];
+ $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
+ }
+ break;
+ case 'ISEMAIL':
+ if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) {
+ $errmsg = $validator['errmsg'];
+ $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
+ }
+ break;
+ case 'ISINT':
+ $tmpval = intval($field_value);
+ if($tmpval === 0 and !empty($field_value)) {
+ $errmsg = $validator['errmsg'];
+ $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
+ }
+ break;
+ case 'ISPOSITIVE':
+ if(!is_numeric($field_value) || $field_value <= 0){
+ $errmsg = $validator['errmsg'];
+ $this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
+ }
+ break;
+ case 'CUSTOM':
+ // Calls a custom class to validate this record
+ if($validator['class'] != '' and $validator['function'] != '') {
+ $validator_class = $validator['class'];
+ $validator_function = $validator['function'];
+ $app->uses($validator_class);
+ $this->errorMessage .= $app->$validator_class->$validator_function($validator);
+ } else {
+ $this->errorMessage .= "Custom validator class or function is empty<br>\r\n";
+ }
+ break;
+ }
+
+
+ }
+
+ return true;
+ }
+
+ /**
+ * SQL Statement f�r Record erzeugen.
+ *
+ * @param record = Datensatz als Array
+ * @param action = INSERT oder UPDATE
+ * @param primary_id
+ * @return record
+ */
+ function getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_where = '') {
+
+ global $app;
+
+ // If there are no data records on the tab, return empty sql string
+ if(count($this->formDef['tabs'][$tab]['fields']) == 0) return '';
+
+ // checking permissions
+ if($this->formDef['auth'] == 'yes') {
+ if($action == "INSERT") {
+ if(!$this->checkPerm($primary_id,'i')) $this->errorMessage .= "Insert denied.<br>\r\n";
+ } else {
+ if(!$this->checkPerm($primary_id,'u')) $this->errorMessage .= "Insert denied.<br>\r\n";
+ }
+ }
+
+ $this->action = $action;
+ $this->primary_id = $primary_id;
+
+ $record = $this->encode($record,$tab);
+ $sql_insert_key = '';
+ $sql_insert_val = '';
+ $sql_update = '';
+
+ if(!is_array($this->formDef)) $app->error("Keine Formulardefinition vorhanden.");
+ if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab).");
+
+ // gehe durch alle Felder des Tabs
+ if(is_array($record)) {
+ foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
+ // Wenn es kein leeres Passwortfeld ist
+ if (!($field['formtype'] == 'PASSWORD' and $record[$key] == '')) {
+ // Erzeuge Insert oder Update Quelltext
+ if($action == "INSERT") {
+ if($field['formtype'] == 'PASSWORD') {
+ $sql_insert_key .= "`$key`, ";
+ if($field['encryption'] == 'CRYPT') {
+ $sql_insert_val .= "'".crypt($record[$key])."', ";
+ } else {
+ $sql_insert_val .= "md5('".$record[$key]."'), ";
+ }
+ } else {
+ $sql_insert_key .= "`$key`, ";
+ $sql_insert_val .= "'".$record[$key]."', ";
+ }
+ } else {
+ if($field['formtype'] == 'PASSWORD') {
+ if($field['encryption'] == 'CRYPT') {
+ $sql_update .= "`$key` = '".crypt($record[$key])."', ";
+ } else {
+ $sql_update .= "`$key` = md5('".$record[$key]."'), ";
+ }
+ } else {
+ $sql_update .= "`$key` = '".$record[$key]."', ";
+ }
+ }
+ }
+ }
+ }
+
+
+ // F�ge Backticks nur bei unvollst�ndigen Tabellennamen ein
+ if(stristr($this->formDef['db_table'],'.')) {
+ $escape = '';
+ } else {
+ $escape = '`';
+ }
+
+
+ if($action == "INSERT") {
+ if($this->formDef['auth'] == 'yes') {
+ // Setze User und Gruppe
+ $sql_insert_key .= "`sys_userid`, ";
+ $sql_insert_val .= ($this->formDef["auth_preset"]["userid"] > 0)?"'".$this->formDef["auth_preset"]["userid"]."', ":"'".$_SESSION["s"]["user"]["userid"]."', ";
+ $sql_insert_key .= "`sys_groupid`, ";
+ $sql_insert_val .= ($this->formDef["auth_preset"]["groupid"] > 0)?"'".$this->formDef["auth_preset"]["groupid"]."', ":"'".$_SESSION["s"]["user"]["default_group"]."', ";
+ $sql_insert_key .= "`sys_perm_user`, ";
+ $sql_insert_val .= "'".$this->formDef["auth_preset"]["perm_user"]."', ";
+ $sql_insert_key .= "`sys_perm_group`, ";
+ $sql_insert_val .= "'".$this->formDef["auth_preset"]["perm_group"]."', ";
+ $sql_insert_key .= "`sys_perm_other`, ";
+ $sql_insert_val .= "'".$this->formDef["auth_preset"]["perm_other"]."', ";
+ }
+ $sql_insert_key = substr($sql_insert_key,0,-2);
+ $sql_insert_val = substr($sql_insert_val,0,-2);
+ $sql = "INSERT INTO ".$escape.$this->formDef['db_table'].$escape." ($sql_insert_key) VALUES ($sql_insert_val)";
+ } 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;
+ if($sql_ext_where != '') $sql .= " and ".$sql_ext_where;
+ } else {
+ $app->error("Primary ID fehlt!");
+ }
+ }
+
+ // Daten in History tabelle speichern
+ if($this->errorMessage == '' and $this->formDef['db_history'] == 'yes') $this->datalogSave($action,$primary_id,$record);
+
+ return $sql;
+ }
+
+ /**
+ * Debugging arrays.
+ *
+ * @param array_data
+ */
+ function dbg($array_data) {
+
+ echo "<pre>";
+ print_r($array_data);
+ echo "</pre>";
+
+ }
+
+
+ function showForm() {
+ global $app,$conf;
+
+ if(!is_array($this->formDef)) die("Form Definition wurde nicht geladen.");
+
+ $active_tab = $this->getNextTab();
+
+ // definiere Tabs
+ foreach( $this->formDef["tabs"] as $key => $tab) {
+
+ $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"];
+
+ // �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"]);
+ $tab["active"] = 1;
+ $_SESSION["s"]["form"]["tab"] = $tab['name'];
+ } else {
+ $tab["active"] = 0;
+ }
+
+ // Die Datenfelder werden f�r die Tabs nicht ben�tigt
+ unset($tab["fields"]);
+ unset($tab["plugins"]);
+
+ $frmTab[] = $tab;
+ }
+
+ // setting form tabs
+ $app->tpl->setLoop("formTab", $frmTab);
+
+ // Set form action
+ $app->tpl->setVar('form_action',$this->formDef["action"]);
+ $app->tpl->setVar('form_active_tab',$active_tab);
+
+ // Set form title
+ $form_hint = '<b>'.$this->formDef["title"].'</b>';
+ if($this->formDef["description"] != '') $form_hint .= '<br><br>'.$this->formDef["description"];
+ $app->tpl->setVar('form_hint',$form_hint);
+
+ // Set Wordbook for this form
+
+ $app->tpl->setVar($this->wordbook);
+ }
+
+
+
+ function datalogSave($action,$primary_id,$record_new) {
+ global $app,$conf;
+
+ // F�ge Backticks nur bei unvollst�ndigen Tabellennamen ein
+ if(stristr($this->formDef['db_table'],'.')) {
+ $escape = '';
+ } else {
+ $escape = '`';
+ }
+
+ if($action == "UPDATE") {
+ $sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id;
+ $record_old = $app->db->queryOneRecord($sql);
+ } else {
+ $record_old = array();
+ }
+
+ $diffrec = array();
+
+ if(is_array($record_new)) {
+ foreach($record_new as $key => $val) {
+ if($record_old[$key] != $val) {
+ // Datensatz hat sich ge�ndert
+ $diffrec[$key] = array('old' => $record_old[$key],
+ 'new' => $val);
+ }
+ }
+ }
+
+ if(count($diffrec) > 0) {
+ $diffstr = $app->db->quote(serialize($diffrec));
+ $username = $app->db->quote($_SESSION["s"]["user"]["username"]);
+ $dbidx = $this->formDef['db_table_idx'].":".$primary_id;
+ $action = ($action == 'INSERT')?'i':'u';
+ $sql = "INSERT INTO sys_datalog (dbtable,dbidx,action,tstamp,user,data) VALUES ('".$this->formDef['db_table']."','$dbidx','$action','".time()."','$username','$diffstr')";
+ $app->db->query($sql);
+ }
+
+ return true;
+
+ }
+
+ function getAuthSQL($perm) {
+
+ $sql = '(';
+ $sql .= "(sys_userid = ".$_SESSION["s"]["user"]["userid"]." AND sys_perm_user like '%$perm%') OR ";
+ $sql .= "(sys_groupid IN (".$_SESSION["s"]["user"]["groups"].") AND sys_perm_group like '%$perm%') OR ";
+ $sql .= "sys_perm_other like '%$perm%'";
+ $sql .= ')';
+
+ return $sql;
+ }
+
+ /*
+ Diese funktion �berpr�ft, ob ein User die Berechtigung $perm f�r den Datensatz mit der ID $record_id
+ hat. It record_id = 0, dann wird gegen die user Defaults des Formulares getestet.
+ */
+ function checkPerm($record_id,$perm) {
+ global $app;
+
+ if($record_id > 0) {
+ // F�ge Backticks nur bei unvollst�ndigen Tabellennamen ein
+ if(stristr($this->formDef['db_table'],'.')) {
+ $escape = '';
+ } else {
+ $escape = '`';
+ }
+
+ $sql = "SELECT ".$this->formDef['db_table_idx']." FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$record_id." AND ".$this->getAuthSQL($perm);
+ if($record = $app->db->queryOneRecord($sql)) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ $result = false;
+ if($this->formDef["auth_preset"]["userid"] == $_SESSION["s"]["user"]["userid"] && stristr($perm,$this->formDef["auth_preset"]["perm_user"])) $result = true;
+ if($this->formDef["auth_preset"]["groupid"] == $_SESSION["s"]["user"]["groupid"] && stristr($perm,$this->formDef["auth_preset"]["perm_group"])) $result = true;
+ if(@stristr($this->formDef["auth_preset"]["perm_other"],$perm)) $result = true;
+
+ // if preset == 0, everyone can insert a record of this type
+ if($this->formDef["auth_preset"]["userid"] == 0 AND $this->formDef["auth_preset"]["groupid"] == 0 AND (@stristr($this->formDef["auth_preset"]["perm_user"],$perm) OR @stristr($this->formDef["auth_preset"]["perm_group"],$perm))) $result = true;
+
+ return $result;
+
+ }
+
+ }
+
+ function getNextTab() {
+ // Welcher Tab wird angezeigt
+ if($this->errorMessage == '') {
+ // wenn kein Fehler vorliegt
+ if($_REQUEST["next_tab"] != '') {
+ // wenn n�chster Tab bekannt
+ $active_tab = $_REQUEST["next_tab"];
+ } else {
+ // ansonsten ersten tab nehmen
+ $active_tab = $this->formDef['tab_default'];
+ }
+ } else {
+ // bei Fehlern den gleichen Tab nochmal anzeigen
+ $active_tab = $_SESSION["s"]["form"]["tab"];
+ }
+
+ return $active_tab;
+ }
+
+ function getCurrentTab() {
+ return $_SESSION["s"]["form"]["tab"];
+ }
+
+}
+
?>
\ No newline at end of file
diff --git a/interface/lib/config.inc.php b/interface/lib/config.inc.php
index 871e4fc..6adc177 100644
--- a/interface/lib/config.inc.php
+++ b/interface/lib/config.inc.php
@@ -1,99 +1,99 @@
-<?php
-/*
-Copyright (c) 2005, Till Brehm, Falko Timme, 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.
-*/
-
-ini_set('register_globals',0);
-
-$conf["app_title"] = "MyDNSConfig";
-$conf["app_version"] = "1.0.0";
-
-$conf["rootpath"] = "F:\\server\\www\\ispconfig3\\interface";
-//$conf["rootpath"] = "D:\\www\\ispconfig3\\interface";
-//$conf["rootpath"] = "/home/www/ispconfig3/web/cms";
-
-$conf["fs_div"] = "\\"; // File system divider, \\ on windows and / on linux and unix
-$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes";
-$conf["temppath"] = $conf["rootpath"].$conf["fs_div"]."temp";
-
-
-/*
- Database Settings
-*/
-
-
-$conf["db_type"] = 'mysql';
-$conf["db_host"] = 'localhost';
-$conf["db_database"] = 'ispconfig3';
-$conf["db_user"] = 'root';
-$conf["db_password"] = '';
-
-
-/*
- External programs
-*/
-
-//$conf["programs"]["convert"] = "/usr/bin/convert";
-$conf["programs"]["wput"] = $conf["rootpath"]."\\tools\\wput\\wput.exe";
-
-
-/*
- Themes
-*/
-
-$conf["theme"] = 'default';
-$conf["html_content_encoding"] = 'text/html; charset=iso-8859-1';
-$conf["logo"] = 'themes/default/images/mydnsconfig_logo.gif';
-
-/*
- Default Language
-*/
-
-$conf["language"] = 'en';
-
-
-/*
- Auto Load Modules
-*/
-
-$conf["start_db"] = true;
-$conf["start_session"] = true;
-
-/*
- DNS Settings
-*/
-
-$conf["auto_create_ptr"] = 1; // Automatically create PTR records?
-$conf["default_ns"] = 'ns1.example.com.'; // must be set if $conf['auto_create_ptr'] is 1. Don't forget the trailing dot!
-$conf["default_mbox"] = 'admin.example.com.'; // Admin email address. Must be set if $conf['auto_create_ptr'] is 1. Replace "@" with ".". Don't forget the trailing dot!
-$conf["default_ttl"] = 86400;
-$conf["default_refresh"] = 28800;
-$conf["default_retry"] = 7200;
-$conf["default_expire"] = 604800;
-$conf["default_minimum_ttl"] = 86400;
-
+<?php
+/*
+Copyright (c) 2005, Till Brehm, Falko Timme, 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.
+*/
+
+ini_set('register_globals',0);
+
+$conf["app_title"] = "ISPConfig";
+$conf["app_version"] = "3.0.0";
+
+//$conf["rootpath"] = "F:\\server\\www\\ispconfig3\\interface";
+$conf["rootpath"] = "D:\\www\\ispconfig3\\interface";
+//$conf["rootpath"] = "/home/www/ispconfig3/web/cms";
+
+$conf["fs_div"] = "\\"; // File system divider, \\ on windows and / on linux and unix
+$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes";
+$conf["temppath"] = $conf["rootpath"].$conf["fs_div"]."temp";
+
+
+/*
+ Database Settings
+*/
+
+
+$conf["db_type"] = 'mysql';
+$conf["db_host"] = 'localhost';
+$conf["db_database"] = 'ispconfig3';
+$conf["db_user"] = 'root';
+$conf["db_password"] = '';
+
+
+/*
+ External programs
+*/
+
+//$conf["programs"]["convert"] = "/usr/bin/convert";
+$conf["programs"]["wput"] = $conf["rootpath"]."\\tools\\wput\\wput.exe";
+
+
+/*
+ Themes
+*/
+
+$conf["theme"] = 'default';
+$conf["html_content_encoding"] = 'text/html; charset=iso-8859-1';
+$conf["logo"] = 'themes/default/images/mydnsconfig_logo.gif';
+
+/*
+ Default Language
+*/
+
+$conf["language"] = 'en';
+
+
+/*
+ Auto Load Modules
+*/
+
+$conf["start_db"] = true;
+$conf["start_session"] = true;
+
+/*
+ DNS Settings
+*/
+
+$conf["auto_create_ptr"] = 1; // Automatically create PTR records?
+$conf["default_ns"] = 'ns1.example.com.'; // must be set if $conf['auto_create_ptr'] is 1. Don't forget the trailing dot!
+$conf["default_mbox"] = 'admin.example.com.'; // Admin email address. Must be set if $conf['auto_create_ptr'] is 1. Replace "@" with ".". Don't forget the trailing dot!
+$conf["default_ttl"] = 86400;
+$conf["default_refresh"] = 28800;
+$conf["default_retry"] = 7200;
+$conf["default_expire"] = 604800;
+$conf["default_minimum_ttl"] = 86400;
+
?>
\ No newline at end of file
diff --git a/interface/sql/ispconfig3db.sql b/interface/sql/ispconfig3db.sql
index d3f9883..984a53c 100644
--- a/interface/sql/ispconfig3db.sql
+++ b/interface/sql/ispconfig3db.sql
@@ -1,305 +1,231 @@
--- phpMyAdmin SQL Dump
--- version 2.6.2-Debian-3sarge1
--- http://www.phpmyadmin.net
---
--- Host: localhost
--- Erstellungszeit: 25. November 2005 um 19:28
--- Server Version: 4.0.24
--- PHP-Version: 4.3.10-16
---
--- Datenbank: `mailserver`
---
+# phpMyAdmin MySQL-Dump
+# version 2.4.0-rc1
+# http://www.phpmyadmin.net/ (download page)
+#
+# Host: localhost
+# Erstellungszeit: 16. Februar 2006 um 22:34
+# Server Version: 4.0.23
+# PHP-Version: 5.0.3
+# Datenbank: `ispconfig3`
+# --------------------------------------------------------
--- --------------------------------------------------------
+#
+# Tabellenstruktur f�r Tabelle `mail_blacklist`
+#
---
--- Tabellenstruktur f�r Tabelle `mail_blacklist`
---
+DROP TABLE IF EXISTS mail_blacklist;
+CREATE TABLE mail_blacklist (
+ blacklist_id int(11) NOT NULL auto_increment,
+ sys_userid int(11) NOT NULL default '0',
+ sys_groupid int(11) NOT NULL default '0',
+ sys_perm_user varchar(5) NOT NULL default '',
+ sys_perm_group varchar(5) NOT NULL default '',
+ sys_perm_other varchar(5) NOT NULL default '',
+ server_id int(11) NOT NULL default '0',
+ address varchar(200) NOT NULL default '',
+ recipient varchar(200) NOT NULL default '',
+ active enum('0','1') NOT NULL default '1',
+ PRIMARY KEY (blacklist_id),
+ KEY server_id (server_id,address,recipient)
+) TYPE=MyISAM;
+# --------------------------------------------------------
-DROP TABLE IF EXISTS `mail_blacklist`;
-CREATE TABLE `mail_blacklist` (
- `blacklist_id` int(11) NOT NULL auto_increment,
- `sys_userid` int(11) NOT NULL default '0',
- `sys_groupid` int(11) NOT NULL default '0',
- `sys_perm_user` varchar(5) NOT NULL default '',
- `sys_perm_group` varchar(5) NOT NULL default '',
- `sys_perm_other` varchar(5) NOT NULL default '',
- `server_id` int(11) NOT NULL default '0',
- `address` varchar(200) NOT NULL default '',
- `recipient` varchar(200) NOT NULL default '',
- `active` enum('0','1') NOT NULL default '1',
- PRIMARY KEY (`blacklist_id`),
- KEY `server_id` (`server_id`,`address`,`recipient`)
-) TYPE=MyISAM AUTO_INCREMENT=3 ;
+#
+# Tabellenstruktur f�r Tabelle `mail_box`
+#
---
--- Daten f�r Tabelle `mail_blacklist`
---
+DROP TABLE IF EXISTS mail_box;
+CREATE TABLE mail_box (
+ mailbox_id int(11) NOT NULL auto_increment,
+ sys_userid int(11) NOT NULL default '0',
+ sys_groupid int(11) NOT NULL default '0',
+ sys_perm_user varchar(5) NOT NULL default '',
+ sys_perm_group varchar(5) NOT NULL default '',
+ sys_perm_other varchar(5) NOT NULL default '',
+ server_id int(11) NOT NULL default '0',
+ email varchar(255) NOT NULL default '',
+ cryptpwd varchar(128) NOT NULL default '',
+ clearpwd varchar(128) NOT NULL default '',
+ name varchar(128) NOT NULL default '',
+ uid int(10) unsigned NOT NULL default '0',
+ gid int(10) unsigned NOT NULL default '0',
+ maildir varchar(255) NOT NULL default '',
+ quota varchar(255) NOT NULL default '',
+ autoresponder enum('0','1') NOT NULL default '0',
+ autoresponder_text tinytext NOT NULL,
+ active enum('0','1') NOT NULL default '1',
+ PRIMARY KEY (mailbox_id),
+ KEY server_id (server_id,email)
+) TYPE=MyISAM;
+# --------------------------------------------------------
-INSERT INTO `mail_blacklist` (`blacklist_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `address`, `recipient`, `active`) VALUES (2, 1, 0, 'riud', 'riud', '', 1, 'till@test.int', 'till@test.int', '0');
+#
+# Tabellenstruktur f�r Tabelle `mail_domain`
+#
--- --------------------------------------------------------
+DROP TABLE IF EXISTS mail_domain;
+CREATE TABLE mail_domain (
+ domain_id int(11) NOT NULL auto_increment,
+ sys_userid int(11) NOT NULL default '0',
+ sys_groupid int(11) NOT NULL default '0',
+ sys_perm_user varchar(5) NOT NULL default '',
+ sys_perm_group varchar(5) NOT NULL default '',
+ sys_perm_other varchar(5) NOT NULL default '',
+ server_id int(11) NOT NULL default '0',
+ domain varchar(255) NOT NULL default '',
+ type enum('local','relay','alias') NOT NULL default 'local',
+ destination varchar(255) NOT NULL default '',
+ active tinyint(4) NOT NULL default '1',
+ PRIMARY KEY (domain_id),
+ KEY server_id (server_id,domain,type)
+) TYPE=MyISAM;
+# --------------------------------------------------------
---
--- Tabellenstruktur f�r Tabelle `mail_box`
---
+#
+# Tabellenstruktur f�r Tabelle `mail_domain_catchall`
+#
-DROP TABLE IF EXISTS `mail_box`;
-CREATE TABLE `mail_box` (
- `mailbox_id` int(11) NOT NULL auto_increment,
- `sys_userid` int(11) NOT NULL default '0',
- `sys_groupid` int(11) NOT NULL default '0',
- `sys_perm_user` varchar(5) NOT NULL default '',
- `sys_perm_group` varchar(5) NOT NULL default '',
- `sys_perm_other` varchar(5) NOT NULL default '',
- `server_id` int(11) NOT NULL default '0',
- `email` varchar(255) NOT NULL default '',
- `cryptpwd` varchar(128) NOT NULL default '',
- `clearpwd` varchar(128) NOT NULL default '',
- `name` varchar(128) NOT NULL default '',
- `uid` int(10) unsigned NOT NULL default '0',
- `gid` int(10) unsigned NOT NULL default '0',
- `maildir` varchar(255) NOT NULL default '',
- `quota` varchar(255) NOT NULL default '',
- `cc` varchar(50) NOT NULL default '',
- `forward` varchar(50) NOT NULL default '',
- `autoresponder` enum('0','1') NOT NULL default '0',
- `autoresponder_text` tinytext NOT NULL,
- `active` enum('0','1') NOT NULL default '1',
- PRIMARY KEY (`mailbox_id`),
- KEY `server_id` (`server_id`,`email`)
-) TYPE=MyISAM AUTO_INCREMENT=2 ;
+DROP TABLE IF EXISTS mail_domain_catchall;
+CREATE TABLE mail_domain_catchall (
+ domain_catchall_id int(11) NOT NULL auto_increment,
+ sys_userid int(11) NOT NULL default '0',
+ sys_groupid int(11) NOT NULL default '0',
+ sys_perm_user varchar(5) NOT NULL default '',
+ sys_perm_group varchar(5) NOT NULL default '',
+ sys_perm_other varchar(5) NOT NULL default '',
+ server_id int(11) NOT NULL default '0',
+ domain varchar(255) NOT NULL default '',
+ destination varchar(255) NOT NULL default '',
+ active enum('0','1') NOT NULL default '1',
+ PRIMARY KEY (domain_catchall_id),
+ KEY server_id (server_id,domain)
+) TYPE=MyISAM;
+# --------------------------------------------------------
---
--- Daten f�r Tabelle `mail_box`
---
+#
+# Tabellenstruktur f�r Tabelle `mail_greylist`
+#
-INSERT INTO `mail_box` (`mailbox_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `email`, `cryptpwd`, `clearpwd`, `name`, `uid`, `gid`, `maildir`, `quota`, `cc`, `forward`, `autoresponder`, `autoresponder_text`, `active`) VALUES (1, 1, 0, 'riud', 'riud', '', 1, 'till@test.int', '$1$tRlfKeOB$iHJgCn8mH8x/dh/XWy6v0/', '', '', 0, 0, '/var/spool/mail/till', '100', '', '', '0', '', '1');
+DROP TABLE IF EXISTS mail_greylist;
+CREATE TABLE mail_greylist (
+ greylist_id int(11) NOT NULL auto_increment,
+ relay_ip varchar(64) default NULL,
+ from_domain varchar(255) default NULL,
+ block_expires datetime NOT NULL default '0000-00-00 00:00:00',
+ record_expires datetime NOT NULL default '0000-00-00 00:00:00',
+ origin_type enum('MANUAL','AUTO') NOT NULL default 'AUTO',
+ create_time datetime NOT NULL default '0000-00-00 00:00:00',
+ PRIMARY KEY (greylist_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
--- --------------------------------------------------------
+#
+# Tabellenstruktur f�r Tabelle `mail_mailman_domain`
+#
---
--- Tabellenstruktur f�r Tabelle `mail_domain`
---
+DROP TABLE IF EXISTS mail_mailman_domain;
+CREATE TABLE mail_mailman_domain (
+ mailman_id int(11) NOT NULL auto_increment,
+ server_id int(11) NOT NULL default '0',
+ domain varchar(255) NOT NULL default '',
+ mm_home varchar(255) NOT NULL default '',
+ mm_wrap varchar(255) NOT NULL default '',
+ mm_user varchar(50) NOT NULL default '',
+ mm_group varchar(50) NOT NULL default '',
+ PRIMARY KEY (mailman_id,server_id,domain)
+) TYPE=MyISAM;
+# --------------------------------------------------------
-DROP TABLE IF EXISTS `mail_domain`;
-CREATE TABLE `mail_domain` (
- `domain_id` int(11) NOT NULL auto_increment,
- `sys_userid` int(11) NOT NULL default '0',
- `sys_groupid` int(11) NOT NULL default '0',
- `sys_perm_user` varchar(5) NOT NULL default '',
- `sys_perm_group` varchar(5) NOT NULL default '',
- `sys_perm_other` varchar(5) NOT NULL default '',
- `server_id` int(11) NOT NULL default '0',
- `domain` varchar(255) NOT NULL default '',
- `type` enum('local','relay','alias') NOT NULL default 'local',
- `relay_host` varchar(255) NOT NULL default '',
- `destination` varchar(255) NOT NULL default '',
- `active` tinyint(4) NOT NULL default '1',
- PRIMARY KEY (`domain_id`),
- KEY `server_id` (`server_id`,`domain`,`type`)
-) TYPE=MyISAM AUTO_INCREMENT=7 ;
+#
+# Tabellenstruktur f�r Tabelle `mail_redirect`
+#
---
--- Daten f�r Tabelle `mail_domain`
---
+DROP TABLE IF EXISTS mail_redirect;
+CREATE TABLE mail_redirect (
+ redirect_id int(11) NOT NULL auto_increment,
+ sys_userid int(11) NOT NULL default '0',
+ sys_groupid int(11) NOT NULL default '0',
+ sys_perm_user varchar(5) NOT NULL default '',
+ sys_perm_group varchar(5) NOT NULL default '',
+ sys_perm_other varchar(5) NOT NULL default '',
+ server_id int(11) NOT NULL default '0',
+ email varchar(255) NOT NULL default '',
+ destination varchar(255) NOT NULL default '',
+ type enum('alias','forward') NOT NULL default 'alias',
+ active enum('0','1') NOT NULL default '1',
+ PRIMARY KEY (redirect_id),
+ KEY server_id (server_id,email)
+) TYPE=MyISAM;
+# --------------------------------------------------------
-INSERT INTO `mail_domain` (`domain_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `domain`, `type`, `relay_host`, `destination`, `active`) VALUES (1, 1, 0, 'riud', 'riud', '', 1, 'test.int', 'local', '', '', 1);
-INSERT INTO `mail_domain` (`domain_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `domain`, `type`, `relay_host`, `destination`, `active`) VALUES (2, 1, 0, 'riud', 'riud', '', 1, 'test2.int', 'alias', '', 'test.int', 1);
-INSERT INTO `mail_domain` (`domain_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `domain`, `type`, `relay_host`, `destination`, `active`) VALUES (5, 1, 0, 'riud', 'riud', '', 1, 'ensign.int', 'alias', '', 'ensign.de', 1);
+#
+# Tabellenstruktur f�r Tabelle `mail_spamfilter`
+#
--- --------------------------------------------------------
+DROP TABLE IF EXISTS mail_spamfilter;
+CREATE TABLE mail_spamfilter (
+ spamfilter_id int(11) NOT NULL auto_increment,
+ sys_userid int(11) NOT NULL default '0',
+ sys_groupid int(11) NOT NULL default '0',
+ sys_perm_user varchar(5) NOT NULL default '',
+ sys_perm_group varchar(5) NOT NULL default '',
+ sys_perm_other varchar(5) NOT NULL default '',
+ server_id int(11) NOT NULL default '0',
+ email varchar(255) NOT NULL default '',
+ spam_rewrite_score_int int(11) NOT NULL default '0',
+ spam_delete_score_int int(11) NOT NULL default '0',
+ spam_redirect_score_int int(11) NOT NULL default '0',
+ spam_rewrite_subject varchar(50) NOT NULL default '***SPAM***',
+ spam_redirect_maildir varchar(255) NOT NULL default '',
+ spam_redirect_maildir_purge int(11) NOT NULL default '7',
+ active enum('0','1') NOT NULL default '1',
+ PRIMARY KEY (spamfilter_id),
+ KEY server_id (server_id,email)
+) TYPE=MyISAM;
+# --------------------------------------------------------
---
--- Tabellenstruktur f�r Tabelle `mail_domain_catchall`
---
+#
+# Tabellenstruktur f�r Tabelle `mail_transport`
+#
-DROP TABLE IF EXISTS `mail_domain_catchall`;
-CREATE TABLE `mail_domain_catchall` (
- `domain_catchall_id` int(11) NOT NULL auto_increment,
- `sys_userid` int(11) NOT NULL default '0',
- `sys_groupid` int(11) NOT NULL default '0',
- `sys_perm_user` varchar(5) NOT NULL default '',
- `sys_perm_group` varchar(5) NOT NULL default '',
- `sys_perm_other` varchar(5) NOT NULL default '',
- `server_id` int(11) NOT NULL default '0',
- `domain` varchar(255) NOT NULL default '',
- `destination` varchar(255) NOT NULL default '',
- `active` enum('0','1') NOT NULL default '1',
- PRIMARY KEY (`domain_catchall_id`),
- KEY `server_id` (`server_id`,`domain`)
-) TYPE=MyISAM AUTO_INCREMENT=2 ;
+DROP TABLE IF EXISTS mail_transport;
+CREATE TABLE mail_transport (
+ whitelist_id int(11) NOT NULL auto_increment,
+ sys_userid int(11) NOT NULL default '0',
+ sys_groupid int(11) NOT NULL default '0',
+ sys_perm_user varchar(5) NOT NULL default '',
+ sys_perm_group varchar(5) NOT NULL default '',
+ sys_perm_other varchar(5) NOT NULL default '',
+ server_id int(11) NOT NULL default '0',
+ domain varchar(255) NOT NULL default '',
+ destination varchar(255) NOT NULL default '',
+ active enum('0','1') NOT NULL default '1',
+ PRIMARY KEY (whitelist_id),
+ KEY server_id (server_id,destination),
+ KEY server_id_2 (server_id,domain)
+) TYPE=MyISAM;
+# --------------------------------------------------------
---
--- Daten f�r Tabelle `mail_domain_catchall`
---
+#
+# Tabellenstruktur f�r Tabelle `mail_whitelist`
+#
-INSERT INTO `mail_domain_catchall` (`domain_catchall_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `domain`, `destination`, `active`) VALUES (1, 1, 1, 'riud', 'riud', '', 1, 'test.int', 'till@test.int', '1');
-
--- --------------------------------------------------------
-
---
--- Tabellenstruktur f�r Tabelle `mail_greylist`
---
-
-DROP TABLE IF EXISTS `mail_greylist`;
-CREATE TABLE `mail_greylist` (
- `greylist_id` int(11) NOT NULL auto_increment,
- `relay_ip` varchar(64) default NULL,
- `from_domain` varchar(255) default NULL,
- `block_expires` datetime NOT NULL default '0000-00-00 00:00:00',
- `record_expires` datetime NOT NULL default '0000-00-00 00:00:00',
- `origin_type` enum('MANUAL','AUTO') NOT NULL default 'AUTO',
- `create_time` datetime NOT NULL default '0000-00-00 00:00:00',
- PRIMARY KEY (`greylist_id`)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
-
---
--- Daten f�r Tabelle `mail_greylist`
---
-
-
--- --------------------------------------------------------
-
---
--- Tabellenstruktur f�r Tabelle `mail_mailman_domain`
---
-
-DROP TABLE IF EXISTS `mail_mailman_domain`;
-CREATE TABLE `mail_mailman_domain` (
- `mailman_id` int(11) NOT NULL auto_increment,
- `server_id` int(11) NOT NULL default '0',
- `domain` varchar(255) NOT NULL default '',
- `mm_home` varchar(255) NOT NULL default '',
- `mm_wrap` varchar(255) NOT NULL default '',
- `mm_user` varchar(50) NOT NULL default '',
- `mm_group` varchar(50) NOT NULL default '',
- PRIMARY KEY (`mailman_id`,`server_id`,`domain`)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
-
---
--- Daten f�r Tabelle `mail_mailman_domain`
---
-
-
--- --------------------------------------------------------
-
---
--- Tabellenstruktur f�r Tabelle `mail_redirect`
---
-
-DROP TABLE IF EXISTS `mail_redirect`;
-CREATE TABLE `mail_redirect` (
- `redirect_id` int(11) NOT NULL auto_increment,
- `sys_userid` int(11) NOT NULL default '0',
- `sys_groupid` int(11) NOT NULL default '0',
- `sys_perm_user` varchar(5) NOT NULL default '',
- `sys_perm_group` varchar(5) NOT NULL default '',
- `sys_perm_other` varchar(5) NOT NULL default '',
- `server_id` int(11) NOT NULL default '0',
- `email` varchar(255) NOT NULL default '',
- `destination` varchar(255) NOT NULL default '',
- `type` enum('alias','forward') NOT NULL default 'alias',
- `active` enum('0','1') NOT NULL default '1',
- PRIMARY KEY (`redirect_id`),
- KEY `server_id` (`server_id`,`email`)
-) TYPE=MyISAM AUTO_INCREMENT=4 ;
-
---
--- Daten f�r Tabelle `mail_redirect`
---
-
-INSERT INTO `mail_redirect` (`redirect_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `email`, `destination`, `type`, `active`) VALUES (1, 1, 0, 'riud', 'riud', '', 1, 'tom@test.int', 'till@test.int', 'alias', '1');
-
--- --------------------------------------------------------
-
---
--- Tabellenstruktur f�r Tabelle `mail_spamfilter`
---
-
-DROP TABLE IF EXISTS `mail_spamfilter`;
-CREATE TABLE `mail_spamfilter` (
- `spamfilter_id` int(11) NOT NULL auto_increment,
- `sys_userid` int(11) NOT NULL default '0',
- `sys_groupid` int(11) NOT NULL default '0',
- `sys_perm_user` varchar(5) NOT NULL default '',
- `sys_perm_group` varchar(5) NOT NULL default '',
- `sys_perm_other` varchar(5) NOT NULL default '',
- `server_id` int(11) NOT NULL default '0',
- `email` varchar(255) NOT NULL default '',
- `spam_rewrite_score_int` int(11) NOT NULL default '0',
- `spam_delete_score_int` int(11) NOT NULL default '0',
- `spam_redirect_score_int` int(11) NOT NULL default '0',
- `spam_rewrite_subject` varchar(50) NOT NULL default '***SPAM***',
- `spam_redirect_maildir` varchar(255) NOT NULL default '',
- `active` enum('0','1') NOT NULL default '1',
- PRIMARY KEY (`spamfilter_id`),
- KEY `server_id` (`server_id`,`email`)
-) TYPE=MyISAM AUTO_INCREMENT=2 ;
-
---
--- Daten f�r Tabelle `mail_spamfilter`
---
-
-INSERT INTO `mail_spamfilter` (`spamfilter_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `email`, `spam_rewrite_score_int`, `spam_delete_score_int`, `spam_redirect_score_int`, `spam_rewrite_subject`, `spam_redirect_maildir`, `active`) VALUES (1, 0, 0, '', '', '', 1, 'till@test.int', 100, 100, 1, '***SPAM mag ich nicht***', '/var/spool/mail/spam', '1');
-
--- --------------------------------------------------------
-
---
--- Tabellenstruktur f�r Tabelle `mail_transport`
---
-
-DROP TABLE IF EXISTS `mail_transport`;
-CREATE TABLE `mail_transport` (
- `whitelist_id` int(11) NOT NULL auto_increment,
- `sys_userid` int(11) NOT NULL default '0',
- `sys_groupid` int(11) NOT NULL default '0',
- `sys_perm_user` varchar(5) NOT NULL default '',
- `sys_perm_group` varchar(5) NOT NULL default '',
- `sys_perm_other` varchar(5) NOT NULL default '',
- `server_id` int(11) NOT NULL default '0',
- `domain` varchar(255) NOT NULL default '',
- `destination` varchar(255) NOT NULL default '',
- `active` enum('0','1') NOT NULL default '1',
- PRIMARY KEY (`whitelist_id`),
- KEY `server_id` (`server_id`,`destination`),
- KEY `server_id_2` (`server_id`,`domain`)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
-
---
--- Daten f�r Tabelle `mail_transport`
---
-
-
--- --------------------------------------------------------
-
---
--- Tabellenstruktur f�r Tabelle `mail_whitelist`
---
-
-DROP TABLE IF EXISTS `mail_whitelist`;
-CREATE TABLE `mail_whitelist` (
- `whitelist_id` int(11) NOT NULL auto_increment,
- `sys_userid` int(11) NOT NULL default '0',
- `sys_groupid` int(11) NOT NULL default '0',
- `sys_perm_user` varchar(5) NOT NULL default '',
- `sys_perm_group` varchar(5) NOT NULL default '',
- `sys_perm_other` varchar(5) NOT NULL default '',
- `server_id` int(11) NOT NULL default '0',
- `address` varchar(255) NOT NULL default '',
- `active` enum('0','1') NOT NULL default '1',
- PRIMARY KEY (`whitelist_id`),
- KEY `server_id` (`server_id`,`address`)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
-
---
--- Daten f�r Tabelle `mail_whitelist`
---
-
-
-
-
--- --------------------------------------------------------
+DROP TABLE IF EXISTS mail_whitelist;
+CREATE TABLE mail_whitelist (
+ whitelist_id int(11) NOT NULL auto_increment,
+ sys_userid int(11) NOT NULL default '0',
+ sys_groupid int(11) NOT NULL default '0',
+ sys_perm_user varchar(5) NOT NULL default '',
+ sys_perm_group varchar(5) NOT NULL default '',
+ sys_perm_other varchar(5) NOT NULL default '',
+ server_id int(11) NOT NULL default '0',
+ address varchar(255) NOT NULL default '',
+ recipient varchar(255) NOT NULL default '',
+ active enum('0','1') NOT NULL default '1',
+ PRIMARY KEY (whitelist_id),
+ KEY server_id (server_id,address)
+) TYPE=MyISAM;
+# --------------------------------------------------------
--
-- Tabellenstruktur f�r Tabelle `reseller`
@@ -351,25 +277,26 @@
-- Tabellenstruktur f�r Tabelle `server`
--
-DROP TABLE IF EXISTS `server`;
-CREATE TABLE `server` (
- `server_id` bigint(20) NOT NULL auto_increment,
- `sys_userid` int(11) NOT NULL default '0',
- `sys_groupid` int(11) NOT NULL default '0',
- `sys_perm_user` varchar(5) NOT NULL default '',
- `sys_perm_group` varchar(5) NOT NULL default '',
- `sys_perm_other` varchar(5) NOT NULL default '',
- `server_name` varchar(255) NOT NULL default '',
- `mail_server` int(11) NOT NULL default '0',
- `web_server` int(11) NOT NULL default '0',
- `dns_server` int(11) NOT NULL default '0',
- `file_server` int(11) NOT NULL default '0',
- `mysql_server` int(11) NOT NULL default '0',
- `postgresql_server` int(11) NOT NULL default '0',
- `firebird_server` int(11) NOT NULL default '0',
- `active` int(11) NOT NULL default '1',
- PRIMARY KEY (`server_id`)
-) TYPE=MyISAM AUTO_INCREMENT=2 ;
+DROP TABLE IF EXISTS server;
+CREATE TABLE server (
+ server_id bigint(20) NOT NULL auto_increment,
+ sys_userid int(11) NOT NULL default '0',
+ sys_groupid int(11) NOT NULL default '0',
+ sys_perm_user varchar(5) NOT NULL default '',
+ sys_perm_group varchar(5) NOT NULL default '',
+ sys_perm_other varchar(5) NOT NULL default '',
+ server_name varchar(255) NOT NULL default '',
+ mail_server int(11) NOT NULL default '0',
+ web_server int(11) NOT NULL default '0',
+ dns_server int(11) NOT NULL default '0',
+ file_server int(11) NOT NULL default '0',
+ mysql_server int(11) NOT NULL default '0',
+ postgresql_server int(11) NOT NULL default '0',
+ firebird_server int(11) NOT NULL default '0',
+ config text NOT NULL,
+ active int(11) NOT NULL default '1',
+ PRIMARY KEY (server_id)
+) TYPE=MyISAM;
--
-- Daten f�r Tabelle `server`
diff --git a/interface/web/sites/form/mail_alias.tform.php b/interface/web/mail/form/mail_alias.tform.php
similarity index 95%
rename from interface/web/sites/form/mail_alias.tform.php
rename to interface/web/mail/form/mail_alias.tform.php
index 4944a93..1223b95 100644
--- a/interface/web/sites/form/mail_alias.tform.php
+++ b/interface/web/mail/form/mail_alias.tform.php
@@ -1,111 +1,114 @@
-<?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"] = "Email Alias";
-$form["description"] = "";
-$form["name"] = "mail_alias";
-$form["action"] = "mail_alias_edit.php";
-$form["db_table"] = "mail_redirect";
-$form["db_table_idx"] = "redirect_id";
-$form["db_history"] = "yes";
-$form["tab_default"] = "alias";
-$form["list_default"] = "mail_alias_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"]['alias'] = array (
- 'title' => "Email alias",
- 'width' => 100,
- 'template' => "templates/mail_alias_edit.htm",
- 'fields' => array (
- ##################################
- # Begin Datatable fields
- ##################################
- 'server_id' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'TEXT',
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'email' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
- 'errmsg'=> 'email_error_isemail'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'destination' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '',
- 'datasource' => array ( 'type' => 'SQL',
- 'querystring' => 'SELECT email FROM mail_box WHERE {AUTHSQL} ORDER BY email',
- 'keyfield' => 'email',
- 'valuefield' => 'email'
- ),
- 'value' => ''
- ),
- 'type' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '',
- 'value' => array('alias' => 'Alias','forward'=>'Forward')
- ),
- 'active' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '1',
- 'value' => '1'
- ),
- ##################################
- # ENDE Datatable fields
- ##################################
- )
-);
-
-
-
+<?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"] = "Email Alias";
+$form["description"] = "";
+$form["name"] = "mail_alias";
+$form["action"] = "mail_alias_edit.php";
+$form["db_table"] = "mail_redirect";
+$form["db_table_idx"] = "redirect_id";
+$form["db_history"] = "yes";
+$form["tab_default"] = "alias";
+$form["list_default"] = "mail_alias_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"]['alias'] = array (
+ 'title' => "Email alias",
+ 'width' => 100,
+ 'template' => "templates/mail_alias_edit.htm",
+ 'fields' => array (
+ ##################################
+ # Begin Datatable fields
+ ##################################
+ 'server_id' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'email' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
+ 'errmsg'=> 'email_error_isemail'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'destination' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'datasource' => array ( 'type' => 'SQL',
+ 'querystring' => 'SELECT email FROM mail_box WHERE {AUTHSQL} ORDER BY email',
+ 'keyfield' => 'email',
+ 'valuefield' => 'email'
+ ),
+ 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
+ 'errmsg'=> 'destination_error_isemail'),
+ ),
+ 'value' => ''
+ ),
+ 'type' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'value' => array('alias' => 'Alias','forward'=>'Forward')
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/form/mail_blacklist.tform.php b/interface/web/mail/form/mail_blacklist.tform.php
similarity index 93%
rename from interface/web/sites/form/mail_blacklist.tform.php
rename to interface/web/mail/form/mail_blacklist.tform.php
index 541d705..6b91c3a 100644
--- a/interface/web/sites/form/mail_blacklist.tform.php
+++ b/interface/web/mail/form/mail_blacklist.tform.php
@@ -1,96 +1,104 @@
-<?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"] = "Email Blacklist";
-$form["description"] = "";
-$form["name"] = "mail_blacklist";
-$form["action"] = "mail_blacklist_edit.php";
-$form["db_table"] = "mail_blacklist";
-$form["db_table_idx"] = "blacklist_id";
-$form["db_history"] = "yes";
-$form["tab_default"] = "blacklist";
-$form["list_default"] = "mail_blacklist_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"]['blacklist'] = array (
- 'title' => "Blacklist",
- 'width' => 100,
- 'template' => "templates/mail_blacklist_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' => ''
- ),
- 'address' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'address_error_notempty'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'active' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '1',
- 'value' => '1'
- ),
- ##################################
- # ENDE Datatable fields
- ##################################
- )
-);
-
-
+<?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"] = "Email Blacklist";
+$form["description"] = "";
+$form["name"] = "mail_blacklist";
+$form["action"] = "mail_blacklist_edit.php";
+$form["db_table"] = "mail_blacklist";
+$form["db_table_idx"] = "blacklist_id";
+$form["db_history"] = "yes";
+$form["tab_default"] = "blacklist";
+$form["list_default"] = "mail_blacklist_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"]['blacklist'] = array (
+ 'title' => "Blacklist",
+ 'width' => 100,
+ 'template' => "templates/mail_blacklist_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' => ''
+ ),
+ 'address' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'address_error_notempty'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'recipient' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/form/mail_box.tform.php b/interface/web/mail/form/mail_box.tform.php
similarity index 88%
rename from interface/web/sites/form/mail_box.tform.php
rename to interface/web/mail/form/mail_box.tform.php
index 68c28a2..0ab736b 100644
--- a/interface/web/sites/form/mail_box.tform.php
+++ b/interface/web/mail/form/mail_box.tform.php
@@ -1,132 +1,151 @@
-<?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"] = "Mailbox";
-$form["description"] = "";
-$form["name"] = "mail_box";
-$form["action"] = "mail_box_edit.php";
-$form["db_table"] = "mail_box";
-$form["db_table_idx"] = "mailbox_id";
-$form["db_history"] = "yes";
-$form["tab_default"] = "mailbox";
-$form["list_default"] = "mail_box_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"]['mailbox'] = array (
- 'title' => "Mailbox",
- 'width' => 100,
- 'template' => "templates/mail_box_mailbox_edit.htm",
- 'fields' => array (
- ##################################
- # Begin Datatable fields
- ##################################
- 'server_id' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'TEXT',
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'email' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
- 'errmsg'=> 'email_error_isemail'),
- 1 => array ( 'type' => 'UNIQUE',
- 'errmsg'=> 'email_error_unique'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'cryptpwd' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'PASSWORD',
- 'encryption'=> 'CRYPT',
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'active' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '1',
- 'value' => '1'
- ),
- ##################################
- # ENDE Datatable fields
- ##################################
- )
-);
-
-$form["tabs"]['autoresponder'] = array (
- 'title' => "Autoresponder",
- 'width' => 100,
- 'template' => "templates/mail_box_autoresponder_edit.htm",
- 'fields' => array (
- ##################################
- # Begin Datatable fields
- ##################################
- 'autoresponder_text' => array (
- 'datatype' => 'TEXT',
- 'formtype' => 'TEXTAREA',
- 'default' => '',
- 'value' => '',
- 'cols' => '30',
- 'rows' => '15'
- ),
- 'autoresponder' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '1',
- 'value' => '1'
- ),
- ##################################
- # ENDE Datatable fields
- ##################################
- )
-);
-
-
+<?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"] = "Mailbox";
+$form["description"] = "";
+$form["name"] = "mail_box";
+$form["action"] = "mail_box_edit.php";
+$form["db_table"] = "mail_box";
+$form["db_table_idx"] = "mailbox_id";
+$form["db_history"] = "yes";
+$form["tab_default"] = "mailbox";
+$form["list_default"] = "mail_box_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"]['mailbox'] = array (
+ 'title' => "Mailbox",
+ 'width' => 100,
+ 'template' => "templates/mail_box_mailbox_edit.htm",
+ 'fields' => array (
+ ##################################
+ # Begin Datatable fields
+ ##################################
+ 'server_id' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'email' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
+ 'errmsg'=> 'email_error_isemail'),
+ 1 => array ( 'type' => 'UNIQUE',
+ 'errmsg'=> 'email_error_unique'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'cryptpwd' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'PASSWORD',
+ 'encryption'=> 'CRYPT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'quota' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'ISINT',
+ 'errmsg'=> 'quota_error_isint'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'maildir' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+$form["tabs"]['autoresponder'] = array (
+ 'title' => "Autoresponder",
+ 'width' => 100,
+ 'template' => "templates/mail_box_autoresponder_edit.htm",
+ 'fields' => array (
+ ##################################
+ # Begin Datatable fields
+ ##################################
+ 'autoresponder_text' => array (
+ 'datatype' => 'TEXT',
+ 'formtype' => 'TEXTAREA',
+ 'default' => '',
+ 'value' => '',
+ 'cols' => '30',
+ 'rows' => '15'
+ ),
+ 'autoresponder' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/form/mail_domain.tform.php b/interface/web/mail/form/mail_domain.tform.php
similarity index 94%
rename from interface/web/sites/form/mail_domain.tform.php
rename to interface/web/mail/form/mail_domain.tform.php
index 81c822a..ecdb76f 100644
--- a/interface/web/sites/form/mail_domain.tform.php
+++ b/interface/web/mail/form/mail_domain.tform.php
@@ -1,104 +1,107 @@
-<?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"] = "Mail Domain";
-$form["description"] = "";
-$form["name"] = "mail_domain";
-$form["action"] = "mail_domain_edit.php";
-$form["db_table"] = "mail_domain";
-$form["db_table_idx"] = "domain_id";
-$form["db_history"] = "yes";
-$form["tab_default"] = "domain";
-$form["list_default"] = "mail_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/mail_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' => ''
- ),
- 'domain' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'domain_error_empty'),
- 1 => array ( 'type' => 'UNIQUE',
- 'errmsg'=> 'domain_error_unique'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'type' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '',
- 'value' => array('local' => 'local','relay'=>'relay','manual_relay'=>'manual Relay')
- ),
- 'active' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '1',
- 'value' => '1'
- ),
- ##################################
- # ENDE Datatable fields
- ##################################
- )
-);
-
-
+<?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"] = "Mail Domain";
+$form["description"] = "";
+$form["name"] = "mail_domain";
+$form["action"] = "mail_domain_edit.php";
+$form["db_table"] = "mail_domain";
+$form["db_table_idx"] = "domain_id";
+$form["db_history"] = "yes";
+$form["tab_default"] = "domain";
+$form["list_default"] = "mail_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/mail_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' => ''
+ ),
+ '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' => '',
+ 'value' => array('local' => 'local','relay'=>'relay','manual_relay'=>'manual Relay')
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/form/mail_domain_alias.tform.php b/interface/web/mail/form/mail_domain_alias.tform.php
similarity index 91%
rename from interface/web/sites/form/mail_domain_alias.tform.php
rename to interface/web/mail/form/mail_domain_alias.tform.php
index d2373d8..499cb47 100644
--- a/interface/web/sites/form/mail_domain_alias.tform.php
+++ b/interface/web/mail/form/mail_domain_alias.tform.php
@@ -1,115 +1,121 @@
-<?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"] = "Mail DomainAlias";
-$form["description"] = "";
-$form["name"] = "mail_domain_alias";
-$form["action"] = "mail_domain_alias_edit.php";
-$form["db_table"] = "mail_domain";
-$form["db_table_idx"] = "domain_id";
-$form["db_history"] = "yes";
-$form["tab_default"] = "domain";
-$form["list_default"] = "mail_domain_alias_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/mail_domain_alias_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 1 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'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'destination' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'destination_error_empty'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'type' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '',
- 'value' => array('alias' => 'alias','local' => 'local','relay'=>'relay','manual_relay'=>'manual Relay')
- ),
- 'active' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '1',
- 'value' => '1'
- ),
- ##################################
- # ENDE Datatable fields
- ##################################
- )
-);
-
-
+<?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"] = "Mail DomainAlias";
+$form["description"] = "";
+$form["name"] = "mail_domain_alias";
+$form["action"] = "mail_domain_alias_edit.php";
+$form["db_table"] = "mail_domain";
+$form["db_table_idx"] = "domain_id";
+$form["db_history"] = "yes";
+$form["tab_default"] = "domain";
+$form["list_default"] = "mail_domain_alias_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/mail_domain_alias_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 1 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'
+ ),
+ 'destination' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'destination_error_empty'),
+ 1 => array ( 'type' => 'REGEX',
+ 'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
+ 'errmsg'=> 'destination_error_regex'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'type' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
+ 'default' => '',
+ 'value' => array('alias' => 'alias','local' => 'local','relay'=>'relay','manual_relay'=>'manual Relay')
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/form/mail_domain_catchall.tform.php b/interface/web/mail/form/mail_domain_catchall.tform.php
similarity index 94%
rename from interface/web/sites/form/mail_domain_catchall.tform.php
rename to interface/web/mail/form/mail_domain_catchall.tform.php
index b7fe7bc..0f16d44 100644
--- a/interface/web/sites/form/mail_domain_catchall.tform.php
+++ b/interface/web/mail/form/mail_domain_catchall.tform.php
@@ -1,104 +1,107 @@
-<?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"] = "Email Catchall";
-$form["description"] = "";
-$form["name"] = "mail_domain_catchall";
-$form["action"] = "mail_domain_catchall_edit.php";
-$form["db_table"] = "mail_domain_catchall";
-$form["db_table_idx"] = "domain_catchall_id";
-$form["db_history"] = "yes";
-$form["tab_default"] = "catchall";
-$form["list_default"] = "mail_domain_catchall_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"]['catchall'] = array (
- 'title' => "Domain Catchall",
- 'width' => 150,
- 'template' => "templates/mail_domain_catchall_edit.htm",
- 'fields' => array (
- ##################################
- # Begin Datatable fields
- ##################################
- 'server_id' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'VARCHAR',
- 'default' => '',
- 'value' => ''
- ),
- 'domain' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'validators' => array ( 0 => array ( 'type' => 'UNIQUE',
- 'errmsg'=> 'domain_error_unique'),
- ),
- 'datasource' => array ( 'type' => 'SQL',
- 'querystring' => "SELECT domain FROM mail_domain WHERE type = 'local' AND {AUTHSQL} ORDER BY domain",
- 'keyfield'=> 'domain',
- 'valuefield'=> 'domain'
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'destination' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'active' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '1',
- 'value' => '1'
- ),
- ##################################
- # ENDE Datatable fields
- ##################################
- )
-);
-
-
+<?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"] = "Email Catchall";
+$form["description"] = "";
+$form["name"] = "mail_domain_catchall";
+$form["action"] = "mail_domain_catchall_edit.php";
+$form["db_table"] = "mail_domain_catchall";
+$form["db_table_idx"] = "domain_catchall_id";
+$form["db_history"] = "yes";
+$form["tab_default"] = "catchall";
+$form["list_default"] = "mail_domain_catchall_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"]['catchall'] = array (
+ 'title' => "Domain Catchall",
+ 'width' => 150,
+ 'template' => "templates/mail_domain_catchall_edit.htm",
+ 'fields' => array (
+ ##################################
+ # Begin Datatable fields
+ ##################################
+ 'server_id' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'VARCHAR',
+ 'default' => '',
+ 'value' => ''
+ ),
+ 'domain' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
+ 'validators' => array ( 0 => array ( 'type' => 'UNIQUE',
+ 'errmsg'=> 'domain_error_unique'),
+ 1 => array ( 'type' => 'REGEX',
+ 'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
+ 'errmsg'=> 'domain_error_regex'),
+ ),
+ 'datasource' => array ( 'type' => 'SQL',
+ 'querystring' => "SELECT domain FROM mail_domain WHERE type = 'local' AND {AUTHSQL} ORDER BY domain",
+ 'keyfield'=> 'domain',
+ 'valuefield'=> 'domain'
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'destination' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/form/mail_domain_relay.tform.php b/interface/web/mail/form/mail_domain_relay.tform.php
similarity index 94%
rename from interface/web/sites/form/mail_domain_relay.tform.php
rename to interface/web/mail/form/mail_domain_relay.tform.php
index eb20803..90e3305 100644
--- a/interface/web/sites/form/mail_domain_relay.tform.php
+++ b/interface/web/mail/form/mail_domain_relay.tform.php
@@ -1,104 +1,107 @@
-<?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"] = "Domain Relay";
-$form["description"] = "";
-$form["name"] = "mail_domain_relay";
-$form["action"] = "mail_domain_relay_edit.php";
-$form["db_table"] = "mail_domain";
-$form["db_table_idx"] = "domain_id";
-$form["db_history"] = "yes";
-$form["tab_default"] = "domain";
-$form["list_default"] = "mail_domain_relay_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/mail_domain_relay_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 1 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'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'type' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'SELECT',
- 'default' => '',
- 'value' => array('relay'=>'relay','local' => 'local','manual_relay'=>'manual Relay')
- ),
- 'active' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '1',
- 'value' => '1'
- ),
- ##################################
- # ENDE Datatable fields
- ##################################
- )
-);
-
-
+<?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"] = "Domain Relay";
+$form["description"] = "";
+$form["name"] = "mail_domain_relay";
+$form["action"] = "mail_domain_relay_edit.php";
+$form["db_table"] = "mail_domain";
+$form["db_table_idx"] = "domain_id";
+$form["db_history"] = "yes";
+$form["tab_default"] = "domain";
+$form["list_default"] = "mail_domain_relay_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/mail_domain_relay_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 1 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' => '',
+ 'value' => array('relay'=>'relay','local' => 'local','manual_relay'=>'manual Relay')
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/form/mail_forward.tform.php b/interface/web/mail/form/mail_forward.tform.php
similarity index 100%
rename from interface/web/sites/form/mail_forward.tform.php
rename to interface/web/mail/form/mail_forward.tform.php
diff --git a/interface/web/mail/form/mail_spamfilter.tform.php b/interface/web/mail/form/mail_spamfilter.tform.php
new file mode 100644
index 0000000..7495fd8
--- /dev/null
+++ b/interface/web/mail/form/mail_spamfilter.tform.php
@@ -0,0 +1,146 @@
+<?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"] = "Spamfilter";
+$form["description"] = "";
+$form["name"] = "mail_spamfilter";
+$form["action"] = "mail_spamfilter_edit.php";
+$form["db_table"] = "mail_spamfilter";
+$form["db_table_idx"] = "spamfilter_id";
+$form["db_history"] = "yes";
+$form["tab_default"] = "spamfilter";
+$form["list_default"] = "mail_spamfilter_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"]['spamfilter'] = array (
+ 'title' => "Spamfilter",
+ 'width' => 100,
+ 'template' => "templates/mail_spamfilter_edit.htm",
+ 'fields' => array (
+ ##################################
+ # Begin Datatable fields
+ ##################################
+ 'server_id' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'email' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'email_error_notempty'),
+ 1 => array ( 'type' => 'UNIQUE',
+ 'errmsg'=> 'email_error_unique'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'spam_rewrite_score_int' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'default' => '5.00',
+ 'value' => '',
+ 'width' => '10',
+ 'maxlength' => '10'
+ ),
+ 'spam_redirect_score_int' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'default' => '7.00',
+ 'value' => '',
+ 'width' => '10',
+ 'maxlength' => '10'
+ ),
+ 'spam_delete_score_int' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'default' => '15.00',
+ 'value' => '',
+ 'width' => '10',
+ 'maxlength' => '10'
+ ),
+ 'spam_rewrite_subject' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '***SPAM***',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'spam_redirect_maildir' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'SELECT',
+ 'datasource' => array ( 'type' => 'SQL',
+ 'querystring' => 'SELECT mailbox_id,email FROM mail_box WHERE {AUTHSQL} ORDER BY email',
+ 'keyfield'=> 'mailbox_id',
+ 'valuefield'=> 'email'
+ ),
+ 'default' => '',
+ 'value' => ''
+ ),
+ 'spam_redirect_maildir_purge' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'TEXT',
+ 'default' => '7',
+ 'value' => '',
+ 'width' => '10',
+ 'maxlength' => '10'
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+
+?>
\ No newline at end of file
diff --git a/interface/web/sites/form/mail_whitelist.tform.php b/interface/web/mail/form/mail_whitelist.tform.php
similarity index 93%
rename from interface/web/sites/form/mail_whitelist.tform.php
rename to interface/web/mail/form/mail_whitelist.tform.php
index b9006bb..69f68e6 100644
--- a/interface/web/sites/form/mail_whitelist.tform.php
+++ b/interface/web/mail/form/mail_whitelist.tform.php
@@ -1,96 +1,104 @@
-<?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"] = "Email Whitelist";
-$form["description"] = "";
-$form["name"] = "mail_whitelist";
-$form["action"] = "mail_whitelist_edit.php";
-$form["db_table"] = "mail_whitelist";
-$form["db_table_idx"] = "whitelist_id";
-$form["db_history"] = "yes";
-$form["tab_default"] = "whitelist";
-$form["list_default"] = "mail_whitelist_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"]['whitelist'] = array (
- 'title' => "Witelist",
- 'width' => 100,
- 'template' => "templates/mail_whitelist_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' => ''
- ),
- 'address' => array (
- 'datatype' => 'VARCHAR',
- 'formtype' => 'TEXT',
- 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
- 'errmsg'=> 'address_error_notempty'),
- ),
- 'default' => '',
- 'value' => '',
- 'width' => '30',
- 'maxlength' => '255'
- ),
- 'active' => array (
- 'datatype' => 'INTEGER',
- 'formtype' => 'CHECKBOX',
- 'default' => '1',
- 'value' => '1'
- ),
- ##################################
- # ENDE Datatable fields
- ##################################
- )
-);
-
-
+<?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"] = "Email Whitelist";
+$form["description"] = "";
+$form["name"] = "mail_whitelist";
+$form["action"] = "mail_whitelist_edit.php";
+$form["db_table"] = "mail_whitelist";
+$form["db_table_idx"] = "whitelist_id";
+$form["db_history"] = "yes";
+$form["tab_default"] = "whitelist";
+$form["list_default"] = "mail_whitelist_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"]['whitelist'] = array (
+ 'title' => "Witelist",
+ 'width' => 100,
+ 'template' => "templates/mail_whitelist_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' => ''
+ ),
+ 'address' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
+ 'errmsg'=> 'address_error_notempty'),
+ ),
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'recipient' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ 'default' => '',
+ 'value' => '',
+ 'width' => '30',
+ 'maxlength' => '255'
+ ),
+ 'active' => array (
+ 'datatype' => 'INTEGER',
+ 'formtype' => 'CHECKBOX',
+ 'default' => '1',
+ 'value' => '1'
+ ),
+ ##################################
+ # ENDE Datatable fields
+ ##################################
+ )
+);
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/admin.conf.php b/interface/web/mail/lib/admin.conf.php
similarity index 100%
rename from interface/web/sites/lib/admin.conf.php
rename to interface/web/mail/lib/admin.conf.php
diff --git a/interface/web/sites/lib/lang/en_mail_alias.lng b/interface/web/mail/lib/lang/en_mail_alias.lng
similarity index 68%
rename from interface/web/sites/lib/lang/en_mail_alias.lng
rename to interface/web/mail/lib/lang/en_mail_alias.lng
index 28c7dda..4023eb6 100644
--- a/interface/web/sites/lib/lang/en_mail_alias.lng
+++ b/interface/web/mail/lib/lang/en_mail_alias.lng
@@ -1,10 +1,11 @@
-<?php
-$wb["email_txt"] = 'Email';
-$wb["destination_txt"] = 'Destination';
-$wb["active_txt"] = 'Active';
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["email_error_isemail"] = 'Emailaddress is empty.';
-$wb["email_error_unique"] = 'Duplicate Emailaddress.';
-$wb["no_domain_perm"] = "You have no permission for this domain.";
+<?php
+$wb["email_txt"] = 'Email';
+$wb["destination_txt"] = 'Destination';
+$wb["active_txt"] = 'Active';
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["email_error_isemail"] = 'Email address is invalid.';
+$wb["email_error_unique"] = 'Duplicate Emailaddress.';
+$wb["no_domain_perm"] = "You have no permission for this domain.";
+$wb["destination_error_isemail"] = 'Destination Emailaddress is invalid.';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_alias_list.lng b/interface/web/mail/lib/lang/en_mail_alias_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/en_mail_alias_list.lng
rename to interface/web/mail/lib/lang/en_mail_alias_list.lng
diff --git a/interface/web/sites/lib/lang/en_mail_blacklist.lng b/interface/web/mail/lib/lang/en_mail_blacklist.lng
similarity index 71%
rename from interface/web/sites/lib/lang/en_mail_blacklist.lng
rename to interface/web/mail/lib/lang/en_mail_blacklist.lng
index a2f71fe..1138100 100644
--- a/interface/web/sites/lib/lang/en_mail_blacklist.lng
+++ b/interface/web/mail/lib/lang/en_mail_blacklist.lng
@@ -1,8 +1,9 @@
-<?php
-$wb["server_id_txt"] = 'Server';
-$wb["address_txt"] = 'Address';
-$wb["active_txt"] = 'Active';
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["address_error_notempty"] = 'Address is empty.';
+<?php
+$wb["server_id_txt"] = 'Server';
+$wb["address_txt"] = 'Block Address';
+$wb["active_txt"] = 'Active';
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["address_error_notempty"] = 'Address is empty.';
+$wb["recipient_txt"] = 'Recipient';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_blacklist_list.lng b/interface/web/mail/lib/lang/en_mail_blacklist_list.lng
similarity index 84%
rename from interface/web/sites/lib/lang/en_mail_blacklist_list.lng
rename to interface/web/mail/lib/lang/en_mail_blacklist_list.lng
index c866e31..cc90ac8 100644
--- a/interface/web/sites/lib/lang/en_mail_blacklist_list.lng
+++ b/interface/web/mail/lib/lang/en_mail_blacklist_list.lng
@@ -1,12 +1,14 @@
-<?php
-$wb["list_head_txt"] = 'Email Blacklist';
-$wb["server_id_txt"] = 'Server';
-$wb["address_txt"] = 'Blacklisted 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 Blacklist record';
+<?php
+$wb["list_head_txt"] = 'Email Blacklist';
+$wb["server_id_txt"] = 'Server';
+$wb["address_txt"] = 'Blacklisted address';
+$wb["recipient_txt"] = 'Recipient';
+$wb["active_txt"] = 'Active';
+$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 Blacklist record';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_box.lng b/interface/web/mail/lib/lang/en_mail_box.lng
similarity index 72%
rename from interface/web/sites/lib/lang/en_mail_box.lng
rename to interface/web/mail/lib/lang/en_mail_box.lng
index ff001ff..7472cc9 100644
--- a/interface/web/sites/lib/lang/en_mail_box.lng
+++ b/interface/web/mail/lib/lang/en_mail_box.lng
@@ -1,13 +1,15 @@
-<?php
-$wb["email_txt"] = 'Email';
-$wb["cryptpwd_txt"] = 'Password';
-$wb["active_txt"] = 'Active';
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["email_error_isemail"] = 'Emailaddress is empty.';
-$wb["email_error_unique"] = 'Duplicate Emailaddress.';
-$wb["autoresponder_text_txt"] = 'Text';
-$wb["autoresponder_txt"] = 'Autoresponder';
-$wb["no_domain_perm"] = "You have no permission for this domain.";
-$wb["error_no_pwd"] = "Password is empty.";
+<?php
+$wb["email_txt"] = 'Email';
+$wb["cryptpwd_txt"] = 'Password';
+$wb["active_txt"] = 'Active';
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["email_error_isemail"] = 'Email address is invalid.';
+$wb["email_error_unique"] = 'Duplicate Emailaddress.';
+$wb["autoresponder_text_txt"] = 'Text';
+$wb["autoresponder_txt"] = 'Autoresponder';
+$wb["no_domain_perm"] = "You have no permission for this domain.";
+$wb["error_no_pwd"] = "Password is empty.";
+$wb["quota_error_isint"] = 'Mailbox size must be a number.';
+$wb["quota_txt"] = 'Mailbox size';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_box_list.lng b/interface/web/mail/lib/lang/en_mail_box_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/en_mail_box_list.lng
rename to interface/web/mail/lib/lang/en_mail_box_list.lng
diff --git a/interface/web/sites/lib/lang/en_mail_domain.lng b/interface/web/mail/lib/lang/en_mail_domain.lng
similarity index 83%
rename from interface/web/sites/lib/lang/en_mail_domain.lng
rename to interface/web/mail/lib/lang/en_mail_domain.lng
index c6a788e..6f89de6 100644
--- a/interface/web/sites/lib/lang/en_mail_domain.lng
+++ b/interface/web/mail/lib/lang/en_mail_domain.lng
@@ -1,12 +1,12 @@
-<?php
-$wb["server_id_txt"] = 'Server';
-$wb["domain_txt"] = 'Domain';
-$wb["type_txt"] = 'Type';
-$wb["active_txt"] = 'Active';
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["domain_error_empty"] = 'Domain is empty.';
-$wb["domain_error_unique"] = 'Duplicate Domain.';
-$wb["destination_error_empty"] = 'Destination is empty.';
-
+<?php
+$wb["server_id_txt"] = 'Server';
+$wb["domain_txt"] = 'Domain';
+$wb["type_txt"] = 'Type';
+$wb["active_txt"] = 'Active';
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["domain_error_empty"] = 'Domain is empty.';
+$wb["domain_error_unique"] = 'Duplicate Domain.';
+$wb["domain_error_regex"] = 'Invalid domain name.';
+
?>
\ No newline at end of file
diff --git a/interface/web/mail/lib/lang/en_mail_domain_alias.lng b/interface/web/mail/lib/lang/en_mail_domain_alias.lng
new file mode 100644
index 0000000..ff39edf
--- /dev/null
+++ b/interface/web/mail/lib/lang/en_mail_domain_alias.lng
@@ -0,0 +1,13 @@
+<?php
+$wb["server_id_txt"] = 'Server';
+$wb["domain_txt"] = 'Domain';
+$wb["destination_txt"] = 'Destination domain';
+$wb["active_txt"] = 'Active';
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["domain_error_empty"] = 'Domain is empty.';
+$wb["domain_error_unique"] = 'Duplicate Domain.';
+$wb["destination_error_empty"] = 'Destination is empty.';
+$wb["domain_error_regex"] = 'Invalid domain name od domain contains invalid characters.';
+$wb["destination_error_regex"] = 'Destination domain is invalid or contains invalid characters.';
+?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_domain_alias_list.lng b/interface/web/mail/lib/lang/en_mail_domain_alias_list.lng
similarity index 92%
rename from interface/web/sites/lib/lang/en_mail_domain_alias_list.lng
rename to interface/web/mail/lib/lang/en_mail_domain_alias_list.lng
index 75d9593..2554f66 100644
--- a/interface/web/sites/lib/lang/en_mail_domain_alias_list.lng
+++ b/interface/web/mail/lib/lang/en_mail_domain_alias_list.lng
@@ -1,13 +1,14 @@
-<?php
-$wb["list_head_txt"] = 'Domain Alias';
-$wb["server_id_txt"] = 'Server';
-$wb["domain_txt"] = 'Domain';
-$wb["destination_txt"] = 'Destination';
-$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 Alias Domain';
+<?php
+$wb["list_head_txt"] = 'Domain Alias';
+$wb["server_id_txt"] = 'Server';
+$wb["domain_txt"] = 'Domain';
+$wb["destination_txt"] = 'Destination';
+$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 Alias Domain';
+$wb["active_txt"] = 'Active';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_domain_catchall.lng b/interface/web/mail/lib/lang/en_mail_domain_catchall.lng
similarity index 78%
rename from interface/web/sites/lib/lang/en_mail_domain_catchall.lng
rename to interface/web/mail/lib/lang/en_mail_domain_catchall.lng
index ca7af2a..f93073b 100644
--- a/interface/web/sites/lib/lang/en_mail_domain_catchall.lng
+++ b/interface/web/mail/lib/lang/en_mail_domain_catchall.lng
@@ -1,9 +1,10 @@
-<?php
-$wb["domain_txt"] = 'Domain';
-$wb["destination_txt"] = 'Destination';
-$wb["active_txt"] = 'Active';
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["domain_error_unique"] = "There is already a Catchall record for this domain.";
-$wb["no_domain_perm"] = "You have no permission for this domain.";
+<?php
+$wb["domain_txt"] = 'Domain';
+$wb["destination_txt"] = 'Destination';
+$wb["active_txt"] = 'Active';
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["domain_error_unique"] = "There is already a Catchall record for this domain.";
+$wb["no_domain_perm"] = "You have no permission for this domain.";
+$wb["domain_error_regex"] = 'Invalid domain name od domain contains invalid characters.';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_domain_catchall_list.lng b/interface/web/mail/lib/lang/en_mail_domain_catchall_list.lng
similarity index 92%
rename from interface/web/sites/lib/lang/en_mail_domain_catchall_list.lng
rename to interface/web/mail/lib/lang/en_mail_domain_catchall_list.lng
index 1144404..a15d797 100644
--- a/interface/web/sites/lib/lang/en_mail_domain_catchall_list.lng
+++ b/interface/web/mail/lib/lang/en_mail_domain_catchall_list.lng
@@ -1,13 +1,14 @@
-<?php
-$wb["list_head_txt"] = 'Email Catchall';
-$wb["server_id_txt"] = 'Server';
-$wb["domain_txt"] = 'Domain';
-$wb["destination_txt"] = 'Destination email 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 Catchall';
+<?php
+$wb["list_head_txt"] = 'Email Catchall';
+$wb["server_id_txt"] = 'Server';
+$wb["domain_txt"] = 'Domain';
+$wb["destination_txt"] = 'Destination email 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 Catchall';
+$wb["active_txt"] = 'Active';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_domain_list.lng b/interface/web/mail/lib/lang/en_mail_domain_list.lng
similarity index 91%
rename from interface/web/sites/lib/lang/en_mail_domain_list.lng
rename to interface/web/mail/lib/lang/en_mail_domain_list.lng
index 2532583..d478868 100644
--- a/interface/web/sites/lib/lang/en_mail_domain_list.lng
+++ b/interface/web/mail/lib/lang/en_mail_domain_list.lng
@@ -1,12 +1,13 @@
-<?php
-$wb["list_head_txt"] = 'Email Domain';
-$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 Domain';
+<?php
+$wb["list_head_txt"] = 'Email Domain';
+$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 Domain';
+$wb["active_txt"] = 'Active';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_domain_relay.lng b/interface/web/mail/lib/lang/en_mail_domain_relay.lng
similarity index 74%
rename from interface/web/sites/lib/lang/en_mail_domain_relay.lng
rename to interface/web/mail/lib/lang/en_mail_domain_relay.lng
index 87c8581..65846b1 100644
--- a/interface/web/sites/lib/lang/en_mail_domain_relay.lng
+++ b/interface/web/mail/lib/lang/en_mail_domain_relay.lng
@@ -1,10 +1,10 @@
-<?php
-$wb["server_id_txt"] = 'Server';
-$wb["domain_txt"] = 'Domain';
-$wb["active_txt"] = 'active';
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["domain_error_empty"] = 'Domain is empty.';
-$wb["domain_error_unique"] = 'Duplicate Domain.';
-$wb["destination_error_empty"] = 'Destination is empty.';
+<?php
+$wb["server_id_txt"] = 'Server';
+$wb["domain_txt"] = 'Domain';
+$wb["active_txt"] = 'active';
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["domain_error_empty"] = 'Domain is empty.';
+$wb["domain_error_unique"] = 'Duplicate Domain.';
+$wb["domain_error_regex"] = 'Invalid domain name od domain contains invalid characters.';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_domain_relay_list.lng b/interface/web/mail/lib/lang/en_mail_domain_relay_list.lng
similarity index 91%
rename from interface/web/sites/lib/lang/en_mail_domain_relay_list.lng
rename to interface/web/mail/lib/lang/en_mail_domain_relay_list.lng
index ac796d0..1b98bf3 100644
--- a/interface/web/sites/lib/lang/en_mail_domain_relay_list.lng
+++ b/interface/web/mail/lib/lang/en_mail_domain_relay_list.lng
@@ -1,12 +1,13 @@
-<?php
-$wb["list_head_txt"] = 'Relay Domain';
-$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 Relay Domain';
+<?php
+$wb["list_head_txt"] = 'Relay Domain';
+$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 Relay Domain';
+$wb["active_txt"] = 'Active';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_forward.lng b/interface/web/mail/lib/lang/en_mail_forward.lng
similarity index 100%
rename from interface/web/sites/lib/lang/en_mail_forward.lng
rename to interface/web/mail/lib/lang/en_mail_forward.lng
diff --git a/interface/web/sites/lib/lang/en_mail_forward_list.lng b/interface/web/mail/lib/lang/en_mail_forward_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/en_mail_forward_list.lng
rename to interface/web/mail/lib/lang/en_mail_forward_list.lng
diff --git a/interface/web/mail/lib/lang/en_mail_spamfilter.lng b/interface/web/mail/lib/lang/en_mail_spamfilter.lng
new file mode 100644
index 0000000..e9013e7
--- /dev/null
+++ b/interface/web/mail/lib/lang/en_mail_spamfilter.lng
@@ -0,0 +1,19 @@
+<?php
+$wb["email_txt"] = 'Email';
+$wb["spam_rewrite_score_int_txt"] = 'Rewrite score';
+$wb["spam_redirect_score_int_txt"] = 'Redirect score';
+$wb["spam_delete_score_int_txt"] = 'Delete score';
+$wb["spam_rewrite_subject_txt"] = 'Rewrite subject';
+$wb["spam_redirect_maildir_txt"] = 'Redirect mailbox';
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["active_txt"] = 'Active';
+$wb["spam_rewrite_txt"] = 'Rewrite email subject above this score.';
+$wb["spam_redirect_txt"] = 'Redirect email above this score to the selected mailbox.';
+$wb["spam_delete_txt"] = 'Delete email above this score.';
+$wb["disable_txt"] = 'Hint: To disable a filtering option, set the score to 0.00.';
+$wb["email_error_isemail"] = 'Email address is invalid.';
+$wb["email_error_unique"] = 'There is already an spamfilter record for this email address.';
+$wb["spam_redirect_maildir_purge_txt"] = 'Purge Maildir after';
+$wb["days_txt"] = 'Days.';
+?>
\ No newline at end of file
diff --git a/interface/web/mail/lib/lang/en_mail_spamfilter_list.lng b/interface/web/mail/lib/lang/en_mail_spamfilter_list.lng
new file mode 100644
index 0000000..69aafff
--- /dev/null
+++ b/interface/web/mail/lib/lang/en_mail_spamfilter_list.lng
@@ -0,0 +1,13 @@
+<?php
+$wb["list_head_txt"] = 'Spamfilter';
+$wb["active_txt"] = 'Active';
+$wb["server_id_txt"] = 'Server';
+$wb["email_txt"] = 'Email';
+$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 Spamfilter record';
+?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_blacklist.lng b/interface/web/mail/lib/lang/en_mail_whitelist.lng
similarity index 70%
copy from interface/web/sites/lib/lang/en_mail_blacklist.lng
copy to interface/web/mail/lib/lang/en_mail_whitelist.lng
index a2f71fe..faf0619 100644
--- a/interface/web/sites/lib/lang/en_mail_blacklist.lng
+++ b/interface/web/mail/lib/lang/en_mail_whitelist.lng
@@ -1,8 +1,9 @@
-<?php
-$wb["server_id_txt"] = 'Server';
-$wb["address_txt"] = 'Address';
-$wb["active_txt"] = 'Active';
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["address_error_notempty"] = 'Address is empty.';
+<?php
+$wb["server_id_txt"] = 'Server';
+$wb["address_txt"] = 'Witelist Address';
+$wb["recipient_txt"] = 'Recipient';
+$wb["active_txt"] = 'Active';
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["address_error_notempty"] = 'Address is empty.';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_whitelist_list.lng b/interface/web/mail/lib/lang/en_mail_whitelist_list.lng
similarity index 84%
rename from interface/web/sites/lib/lang/en_mail_whitelist_list.lng
rename to interface/web/mail/lib/lang/en_mail_whitelist_list.lng
index cb982b4..71f7639 100644
--- a/interface/web/sites/lib/lang/en_mail_whitelist_list.lng
+++ b/interface/web/mail/lib/lang/en_mail_whitelist_list.lng
@@ -1,12 +1,14 @@
-<?php
-$wb["list_head_txt"] = 'Email Whitelist';
-$wb["server_id_txt"] = 'Server';
-$wb["address_txt"] = 'Whitelisted 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 Whitelist record';
+<?php
+$wb["list_head_txt"] = 'Email Whitelist';
+$wb["server_id_txt"] = 'Server';
+$wb["address_txt"] = 'Whitelisted address';
+$wb["recipient_txt"] = 'Recipient';
+$wb["active_txt"] = 'Active';
+$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 Whitelist record';
?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/fr_mail_domain.lng b/interface/web/mail/lib/lang/fr_mail_domain.lng
similarity index 100%
rename from interface/web/sites/lib/lang/fr_mail_domain.lng
rename to interface/web/mail/lib/lang/fr_mail_domain.lng
diff --git a/interface/web/sites/lib/lang/fr_mail_domain_list.lng b/interface/web/mail/lib/lang/fr_mail_domain_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/fr_mail_domain_list.lng
rename to interface/web/mail/lib/lang/fr_mail_domain_list.lng
diff --git a/interface/web/sites/lib/lang/se_mail_alias.lng b/interface/web/mail/lib/lang/se_mail_alias.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_alias.lng
rename to interface/web/mail/lib/lang/se_mail_alias.lng
diff --git a/interface/web/sites/lib/lang/se_mail_alias_list.lng b/interface/web/mail/lib/lang/se_mail_alias_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_alias_list.lng
rename to interface/web/mail/lib/lang/se_mail_alias_list.lng
diff --git a/interface/web/sites/lib/lang/se_mail_blacklist.lng b/interface/web/mail/lib/lang/se_mail_blacklist.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_blacklist.lng
rename to interface/web/mail/lib/lang/se_mail_blacklist.lng
diff --git a/interface/web/sites/lib/lang/se_mail_blacklist_list.lng b/interface/web/mail/lib/lang/se_mail_blacklist_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_blacklist_list.lng
rename to interface/web/mail/lib/lang/se_mail_blacklist_list.lng
diff --git a/interface/web/sites/lib/lang/se_mail_box.lng b/interface/web/mail/lib/lang/se_mail_box.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_box.lng
rename to interface/web/mail/lib/lang/se_mail_box.lng
diff --git a/interface/web/sites/lib/lang/se_mail_box_list.lng b/interface/web/mail/lib/lang/se_mail_box_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_box_list.lng
rename to interface/web/mail/lib/lang/se_mail_box_list.lng
diff --git a/interface/web/sites/lib/lang/se_mail_domain.lng b/interface/web/mail/lib/lang/se_mail_domain.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_domain.lng
rename to interface/web/mail/lib/lang/se_mail_domain.lng
diff --git a/interface/web/sites/lib/lang/se_mail_domain_alias.lng b/interface/web/mail/lib/lang/se_mail_domain_alias.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_domain_alias.lng
rename to interface/web/mail/lib/lang/se_mail_domain_alias.lng
diff --git a/interface/web/sites/lib/lang/se_mail_domain_alias_list.lng b/interface/web/mail/lib/lang/se_mail_domain_alias_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_domain_alias_list.lng
rename to interface/web/mail/lib/lang/se_mail_domain_alias_list.lng
diff --git a/interface/web/sites/lib/lang/se_mail_domain_catchall.lng b/interface/web/mail/lib/lang/se_mail_domain_catchall.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_domain_catchall.lng
rename to interface/web/mail/lib/lang/se_mail_domain_catchall.lng
diff --git a/interface/web/sites/lib/lang/se_mail_domain_catchall_list.lng b/interface/web/mail/lib/lang/se_mail_domain_catchall_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_domain_catchall_list.lng
rename to interface/web/mail/lib/lang/se_mail_domain_catchall_list.lng
diff --git a/interface/web/sites/lib/lang/se_mail_domain_list.lng b/interface/web/mail/lib/lang/se_mail_domain_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_domain_list.lng
rename to interface/web/mail/lib/lang/se_mail_domain_list.lng
diff --git a/interface/web/sites/lib/lang/se_mail_domain_relay.lng b/interface/web/mail/lib/lang/se_mail_domain_relay.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_domain_relay.lng
rename to interface/web/mail/lib/lang/se_mail_domain_relay.lng
diff --git a/interface/web/sites/lib/lang/se_mail_domain_relay_list.lng b/interface/web/mail/lib/lang/se_mail_domain_relay_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_domain_relay_list.lng
rename to interface/web/mail/lib/lang/se_mail_domain_relay_list.lng
diff --git a/interface/web/sites/lib/lang/se_mail_forward.lng b/interface/web/mail/lib/lang/se_mail_forward.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_forward.lng
rename to interface/web/mail/lib/lang/se_mail_forward.lng
diff --git a/interface/web/sites/lib/lang/se_mail_forward_list.lng b/interface/web/mail/lib/lang/se_mail_forward_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_forward_list.lng
rename to interface/web/mail/lib/lang/se_mail_forward_list.lng
diff --git a/interface/web/sites/lib/lang/se_mail_whitelist.lng b/interface/web/mail/lib/lang/se_mail_whitelist.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_whitelist.lng
rename to interface/web/mail/lib/lang/se_mail_whitelist.lng
diff --git a/interface/web/sites/lib/lang/se_mail_whitelist_list.lng b/interface/web/mail/lib/lang/se_mail_whitelist_list.lng
similarity index 100%
rename from interface/web/sites/lib/lang/se_mail_whitelist_list.lng
rename to interface/web/mail/lib/lang/se_mail_whitelist_list.lng
diff --git a/interface/web/mail/lib/module.conf.php b/interface/web/mail/lib/module.conf.php
new file mode 100644
index 0000000..f6de41f
--- /dev/null
+++ b/interface/web/mail/lib/module.conf.php
@@ -0,0 +1,109 @@
+<?php
+$module = array (
+ 'name' => 'mail',
+ 'title' => 'Email',
+ 'template' => 'module.tpl.htm',
+ 'navframe_page' => '',
+ 'startpage' => 'mail/index.php',
+ 'tab_width' => '',
+ 'nav' =>
+ array (
+ 0 =>
+ array (
+ 'title' => 'Email Accounts',
+ 'open' => 1,
+ 'items' =>
+ array (
+ 0 =>
+ array (
+ 'title' => 'Domain',
+ 'target' => 'content',
+ 'link' => 'mail/mail_domain_list.php',
+ ),
+ 1 =>
+ array (
+ 'title' => 'Domain Alias',
+ 'target' => 'content',
+ 'link' => 'mail/mail_domain_alias_list.php',
+ ),
+ 2 =>
+ array (
+ 'title' => 'Domain Relay',
+ 'target' => 'content',
+ 'link' => 'mail/mail_domain_relay_list.php',
+ ),
+ 3 =>
+ array (
+ 'title' => 'Email Mailbox',
+ 'target' => 'content',
+ 'link' => 'mail/mail_box_list.php',
+ ),
+ 4 =>
+ array (
+ 'title' => 'Email Alias',
+ 'target' => 'content',
+ 'link' => 'mail/mail_alias_list.php',
+ ),
+ 5 =>
+ array (
+ 'title' => 'Email Forward',
+ 'target' => 'content',
+ 'link' => 'mail/mail_forward_list.php',
+ ),
+ 6 =>
+ array (
+ 'title' => 'Email Catchall',
+ 'target' => 'content',
+ 'link' => 'mail/mail_domain_catchall_list.php',
+ ),
+ 7 =>
+ array (
+ 'title' => 'Email Routing',
+ 'target' => 'content',
+ 'link' => '',
+ ),
+ ),
+ ),
+ 1 =>
+ array (
+ 'title' => 'Email Filter',
+ 'open' => 1,
+ 'items' =>
+ array (
+ 0 =>
+ array (
+ 'title' => 'Whitelist',
+ 'target' => 'content',
+ 'link' => 'mail/mail_whitelist_list.php',
+ ),
+ 1 =>
+ array (
+ 'title' => 'Blacklist',
+ 'target' => 'content',
+ 'link' => 'mail/mail_blacklist_list.php',
+ ),
+ 2 =>
+ array (
+ 'title' => 'Spamfilter',
+ 'target' => 'content',
+ 'link' => 'mail/mail_spamfilter_list.php',
+ ),
+ ),
+ ),
+ 2 =>
+ array (
+ 'title' => 'Fetchmail',
+ 'open' => 1,
+ 'items' =>
+ array (
+ 0 =>
+ array (
+ 'title' => 'Fetchmail Accounts',
+ 'target' => 'content',
+ 'link' => 'mail/fetchmail_list.php',
+ ),
+ ),
+ ),
+ ),
+)
+?>
\ No newline at end of file
diff --git a/interface/web/sites/list/mail_alias.list.php b/interface/web/mail/list/mail_alias.list.php
similarity index 100%
rename from interface/web/sites/list/mail_alias.list.php
rename to interface/web/mail/list/mail_alias.list.php
diff --git a/interface/web/sites/list/mail_blacklist.list.php b/interface/web/mail/list/mail_blacklist.list.php
similarity index 64%
rename from interface/web/sites/list/mail_blacklist.list.php
rename to interface/web/mail/list/mail_blacklist.list.php
index 90315cc..12308e5 100644
--- a/interface/web/sites/list/mail_blacklist.list.php
+++ b/interface/web/mail/list/mail_blacklist.list.php
@@ -1,69 +1,93 @@
-<?php
-
-/*
- Datatypes:
- - INTEGER
- - DOUBLE
- - CURRENCY
- - VARCHAR
- - TEXT
- - DATE
-*/
-
-
-
-// Name of the list
-$liste["name"] = "mail_blacklist";
-
-// Database table
-$liste["table"] = "mail_blacklist";
-
-// Index index field of the database table
-$liste["table_idx"] = "blacklist_id";
-
-// Search Field Prefix
-$liste["search_prefix"] = "search_";
-
-// Records per page
-$liste["records_per_page"] = 15;
-
-// Script File of the list
-$liste["file"] = "mail_blacklist_list.php";
-
-// Script file of the edit form
-$liste["edit_file"] = "mail_blacklist_edit.php";
-
-// Script File of the delete script
-$liste["delete_file"] = "mail_blacklist_del.php";
-
-// Paging Template
-$liste["paging_tpl"] = "templates/paging.tpl.htm";
-
-// Enable auth
-$liste["auth"] = "yes";
-
-
-/*****************************************************
-* Suchfelder
-*****************************************************/
-
-$liste["item"][] = array( 'field' => "server_id",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-$liste["item"][] = array( 'field' => "address",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-
+<?php
+
+/*
+ Datatypes:
+ - INTEGER
+ - DOUBLE
+ - CURRENCY
+ - VARCHAR
+ - TEXT
+ - DATE
+*/
+
+
+
+// Name of the list
+$liste["name"] = "mail_blacklist";
+
+// Database table
+$liste["table"] = "mail_blacklist";
+
+// Index index field of the database table
+$liste["table_idx"] = "blacklist_id";
+
+// Search Field Prefix
+$liste["search_prefix"] = "search_";
+
+// Records per page
+$liste["records_per_page"] = 15;
+
+// Script File of the list
+$liste["file"] = "mail_blacklist_list.php";
+
+// Script file of the edit form
+$liste["edit_file"] = "mail_blacklist_edit.php";
+
+// Script File of the delete script
+$liste["delete_file"] = "mail_blacklist_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('1' => "Yes",'0' => "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' => "address",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
+
+
+$liste["item"][] = array( 'field' => "recipient",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/list/mail_box.list.php b/interface/web/mail/list/mail_box.list.php
similarity index 100%
rename from interface/web/sites/list/mail_box.list.php
rename to interface/web/mail/list/mail_box.list.php
diff --git a/interface/web/sites/list/mail_domain.list.php b/interface/web/mail/list/mail_domain.list.php
similarity index 70%
rename from interface/web/sites/list/mail_domain.list.php
rename to interface/web/mail/list/mail_domain.list.php
index 07c4681..359a6df 100644
--- a/interface/web/sites/list/mail_domain.list.php
+++ b/interface/web/mail/list/mail_domain.list.php
@@ -1,69 +1,85 @@
-<?php
-
-/*
- Datatypes:
- - INTEGER
- - DOUBLE
- - CURRENCY
- - VARCHAR
- - TEXT
- - DATE
-*/
-
-
-
-// Name of the list
-$liste["name"] = "mail_domain";
-
-// Database table
-$liste["table"] = "mail_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"] = "mail_domain_list.php";
-
-// Script file of the edit form
-$liste["edit_file"] = "mail_domain_edit.php";
-
-// Script File of the delete script
-$liste["delete_file"] = "mail_domain_del.php";
-
-// Paging Template
-$liste["paging_tpl"] = "templates/paging.tpl.htm";
-
-// Enable auth
-$liste["auth"] = "yes";
-
-
-/*****************************************************
-* Suchfelder
-*****************************************************/
-
-$liste["item"][] = array( 'field' => "server_id",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-$liste["item"][] = array( 'field' => "domain",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-
+<?php
+
+/*
+ Datatypes:
+ - INTEGER
+ - DOUBLE
+ - CURRENCY
+ - VARCHAR
+ - TEXT
+ - DATE
+*/
+
+
+
+// Name of the list
+$liste["name"] = "mail_domain";
+
+// Database table
+$liste["table"] = "mail_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"] = "mail_domain_list.php";
+
+// Script file of the edit form
+$liste["edit_file"] = "mail_domain_edit.php";
+
+// Script File of the delete script
+$liste["delete_file"] = "mail_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('1' => "Yes",'0' => "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' => "");
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/list/mail_domain_alias.list.php b/interface/web/mail/list/mail_domain_alias.list.php
similarity index 73%
rename from interface/web/sites/list/mail_domain_alias.list.php
rename to interface/web/mail/list/mail_domain_alias.list.php
index 8859008..06965c4 100644
--- a/interface/web/sites/list/mail_domain_alias.list.php
+++ b/interface/web/mail/list/mail_domain_alias.list.php
@@ -1,77 +1,92 @@
-<?php
-
-/*
- Datatypes:
- - INTEGER
- - DOUBLE
- - CURRENCY
- - VARCHAR
- - TEXT
- - DATE
-*/
-
-
-
-// Name of the list
-$liste["name"] = "mail_domain_alias";
-
-// Database table
-$liste["table"] = "mail_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"] = "mail_domain_alias_list.php";
-
-// Script file of the edit form
-$liste["edit_file"] = "mail_domain_alias_edit.php";
-
-// Script File of the delete script
-$liste["delete_file"] = "mail_domain_alias_del.php";
-
-// Paging Template
-$liste["paging_tpl"] = "templates/paging.tpl.htm";
-
-// Enable auth
-$liste["auth"] = "yes";
-
-
-/*****************************************************
-* Suchfelder
-*****************************************************/
-
-$liste["item"][] = array( 'field' => "server_id",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-$liste["item"][] = array( 'field' => "domain",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-$liste["item"][] = array( 'field' => "destination",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
+<?php
+
+/*
+ Datatypes:
+ - INTEGER
+ - DOUBLE
+ - CURRENCY
+ - VARCHAR
+ - TEXT
+ - DATE
+*/
+
+
+
+// Name of the list
+$liste["name"] = "mail_domain_alias";
+
+// Database table
+$liste["table"] = "mail_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"] = "mail_domain_alias_list.php";
+
+// Script file of the edit form
+$liste["edit_file"] = "mail_domain_alias_edit.php";
+
+// Script File of the delete script
+$liste["delete_file"] = "mail_domain_alias_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('1' => "Yes",'0' => "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' => "");
+
+$liste["item"][] = array( 'field' => "destination",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/list/mail_domain_catchall.list.php b/interface/web/mail/list/mail_domain_catchall.list.php
similarity index 86%
rename from interface/web/sites/list/mail_domain_catchall.list.php
rename to interface/web/mail/list/mail_domain_catchall.list.php
index 131343e..c6f9c30 100644
--- a/interface/web/sites/list/mail_domain_catchall.list.php
+++ b/interface/web/mail/list/mail_domain_catchall.list.php
@@ -1,76 +1,85 @@
-<?php
-
-/*
- Datatypes:
- - INTEGER
- - DOUBLE
- - CURRENCY
- - VARCHAR
- - TEXT
- - DATE
-*/
-
-
-
-// Name of the list
-$liste["name"] = "mail_domain_catchall";
-
-// Database table
-$liste["table"] = "mail_domain_catchall";
-
-// Index index field of the database table
-$liste["table_idx"] = "domain_catchall_id";
-
-// Search Field Prefix
-$liste["search_prefix"] = "search_";
-
-// Records per page
-$liste["records_per_page"] = 15;
-
-// Script File of the list
-$liste["file"] = "mail_domain_catchall_list.php";
-
-// Script file of the edit form
-$liste["edit_file"] = "mail_domain_catchall_edit.php";
-
-// Script File of the delete script
-$liste["delete_file"] = "mail_domain_catchall_del.php";
-
-// Paging Template
-$liste["paging_tpl"] = "templates/paging.tpl.htm";
-
-// Enable auth
-$liste["auth"] = "yes";
-
-
-/*****************************************************
-* Suchfelder
-*****************************************************/
-
-$liste["item"][] = array( 'field' => "server_id",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-$liste["item"][] = array( 'field' => "domain",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-$liste["item"][] = array( 'field' => "destination",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
+<?php
+
+/*
+ Datatypes:
+ - INTEGER
+ - DOUBLE
+ - CURRENCY
+ - VARCHAR
+ - TEXT
+ - DATE
+*/
+
+
+
+// Name of the list
+$liste["name"] = "mail_domain_catchall";
+
+// Database table
+$liste["table"] = "mail_domain_catchall";
+
+// Index index field of the database table
+$liste["table_idx"] = "domain_catchall_id";
+
+// Search Field Prefix
+$liste["search_prefix"] = "search_";
+
+// Records per page
+$liste["records_per_page"] = 15;
+
+// Script File of the list
+$liste["file"] = "mail_domain_catchall_list.php";
+
+// Script file of the edit form
+$liste["edit_file"] = "mail_domain_catchall_edit.php";
+
+// Script File of the delete script
+$liste["delete_file"] = "mail_domain_catchall_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('1' => "Yes",'0' => "No"));
+
+$liste["item"][] = array( 'field' => "server_id",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
+
+$liste["item"][] = array( 'field' => "domain",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
+
+$liste["item"][] = array( 'field' => "destination",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
?>
\ No newline at end of file
diff --git a/interface/web/sites/list/mail_domain_relay.list.php b/interface/web/mail/list/mail_domain_relay.list.php
similarity index 70%
rename from interface/web/sites/list/mail_domain_relay.list.php
rename to interface/web/mail/list/mail_domain_relay.list.php
index 9f0ea35..1f97ea5 100644
--- a/interface/web/sites/list/mail_domain_relay.list.php
+++ b/interface/web/mail/list/mail_domain_relay.list.php
@@ -1,68 +1,83 @@
-<?php
-
-/*
- Datatypes:
- - INTEGER
- - DOUBLE
- - CURRENCY
- - VARCHAR
- - TEXT
- - DATE
-*/
-
-
-
-// Name of the list
-$liste["name"] = "mail_domain_relay";
-
-// Database table
-$liste["table"] = "mail_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"] = "mail_domain_relay_list.php";
-
-// Script file of the edit form
-$liste["edit_file"] = "mail_domain_relay_edit.php";
-
-// Script File of the delete script
-$liste["delete_file"] = "mail_domain_relay_del.php";
-
-// Paging Template
-$liste["paging_tpl"] = "templates/paging.tpl.htm";
-
-// Enable auth
-$liste["auth"] = "yes";
-
-
-/*****************************************************
-* Suchfelder
-*****************************************************/
-
-$liste["item"][] = array( 'field' => "server_id",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-$liste["item"][] = array( 'field' => "domain",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
+<?php
+
+/*
+ Datatypes:
+ - INTEGER
+ - DOUBLE
+ - CURRENCY
+ - VARCHAR
+ - TEXT
+ - DATE
+*/
+
+
+
+// Name of the list
+$liste["name"] = "mail_domain_relay";
+
+// Database table
+$liste["table"] = "mail_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"] = "mail_domain_relay_list.php";
+
+// Script file of the edit form
+$liste["edit_file"] = "mail_domain_relay_edit.php";
+
+// Script File of the delete script
+$liste["delete_file"] = "mail_domain_relay_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('1' => "Yes",'0' => "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' => "");
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/list/mail_forward.list.php b/interface/web/mail/list/mail_forward.list.php
similarity index 100%
rename from interface/web/sites/list/mail_forward.list.php
rename to interface/web/mail/list/mail_forward.list.php
diff --git a/interface/web/mail/list/mail_spamfilter.list.php b/interface/web/mail/list/mail_spamfilter.list.php
new file mode 100644
index 0000000..d959918
--- /dev/null
+++ b/interface/web/mail/list/mail_spamfilter.list.php
@@ -0,0 +1,85 @@
+<?php
+
+/*
+ Datatypes:
+ - INTEGER
+ - DOUBLE
+ - CURRENCY
+ - VARCHAR
+ - TEXT
+ - DATE
+*/
+
+
+
+// Name of the list
+$liste["name"] = "mail_spamfilter";
+
+// Database table
+$liste["table"] = "mail_spamfilter";
+
+// Index index field of the database table
+$liste["table_idx"] = "spamfilter_id";
+
+// Search Field Prefix
+$liste["search_prefix"] = "search_";
+
+// Records per page
+$liste["records_per_page"] = 15;
+
+// Script File of the list
+$liste["file"] = "mail_spamfilter_list.php";
+
+// Script file of the edit form
+$liste["edit_file"] = "mail_spamfilter_edit.php";
+
+// Script File of the delete script
+$liste["delete_file"] = "mail_spamfilter_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('1' => "Yes",'0' => "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' => "email",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
+
+
+
+?>
\ No newline at end of file
diff --git a/interface/web/sites/list/mail_whitelist.list.php b/interface/web/mail/list/mail_whitelist.list.php
similarity index 64%
rename from interface/web/sites/list/mail_whitelist.list.php
rename to interface/web/mail/list/mail_whitelist.list.php
index 8284766..79a582c 100644
--- a/interface/web/sites/list/mail_whitelist.list.php
+++ b/interface/web/mail/list/mail_whitelist.list.php
@@ -1,69 +1,93 @@
-<?php
-
-/*
- Datatypes:
- - INTEGER
- - DOUBLE
- - CURRENCY
- - VARCHAR
- - TEXT
- - DATE
-*/
-
-
-
-// Name of the list
-$liste["name"] = "mail_whitelist";
-
-// Database table
-$liste["table"] = "mail_whitelist";
-
-// Index index field of the database table
-$liste["table_idx"] = "whitelist_id";
-
-// Search Field Prefix
-$liste["search_prefix"] = "search_";
-
-// Records per page
-$liste["records_per_page"] = 15;
-
-// Script File of the list
-$liste["file"] = "mail_whitelist_list.php";
-
-// Script file of the edit form
-$liste["edit_file"] = "mail_whitelist_edit.php";
-
-// Script File of the delete script
-$liste["delete_file"] = "mail_whitelist_del.php";
-
-// Paging Template
-$liste["paging_tpl"] = "templates/paging.tpl.htm";
-
-// Enable auth
-$liste["auth"] = "yes";
-
-
-/*****************************************************
-* Suchfelder
-*****************************************************/
-
-$liste["item"][] = array( 'field' => "server_id",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-$liste["item"][] = array( 'field' => "address",
- 'datatype' => "VARCHAR",
- 'formtype' => "TEXT",
- 'op' => "like",
- 'prefix' => "%",
- 'suffix' => "%",
- 'width' => "",
- 'value' => "");
-
-
+<?php
+
+/*
+ Datatypes:
+ - INTEGER
+ - DOUBLE
+ - CURRENCY
+ - VARCHAR
+ - TEXT
+ - DATE
+*/
+
+
+
+// Name of the list
+$liste["name"] = "mail_whitelist";
+
+// Database table
+$liste["table"] = "mail_whitelist";
+
+// Index index field of the database table
+$liste["table_idx"] = "whitelist_id";
+
+// Search Field Prefix
+$liste["search_prefix"] = "search_";
+
+// Records per page
+$liste["records_per_page"] = 15;
+
+// Script File of the list
+$liste["file"] = "mail_whitelist_list.php";
+
+// Script file of the edit form
+$liste["edit_file"] = "mail_whitelist_edit.php";
+
+// Script File of the delete script
+$liste["delete_file"] = "mail_whitelist_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('1' => "Yes",'0' => "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' => "address",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
+
+$liste["item"][] = array( 'field' => "recipient",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_alias_del.php b/interface/web/mail/mail_alias_del.php
similarity index 100%
rename from interface/web/sites/mail_alias_del.php
rename to interface/web/mail/mail_alias_del.php
diff --git a/interface/web/sites/mail_alias_edit.php b/interface/web/mail/mail_alias_edit.php
similarity index 100%
rename from interface/web/sites/mail_alias_edit.php
rename to interface/web/mail/mail_alias_edit.php
diff --git a/interface/web/sites/mail_alias_list.php b/interface/web/mail/mail_alias_list.php
similarity index 100%
rename from interface/web/sites/mail_alias_list.php
rename to interface/web/mail/mail_alias_list.php
diff --git a/interface/web/sites/mail_blacklist_del.php b/interface/web/mail/mail_blacklist_del.php
similarity index 100%
rename from interface/web/sites/mail_blacklist_del.php
rename to interface/web/mail/mail_blacklist_del.php
diff --git a/interface/web/sites/mail_box_edit.php b/interface/web/mail/mail_blacklist_edit.php
similarity index 74%
copy from interface/web/sites/mail_box_edit.php
copy to interface/web/mail/mail_blacklist_edit.php
index 4d007a7..4caf034 100644
--- a/interface/web/sites/mail_box_edit.php
+++ b/interface/web/mail/mail_blacklist_edit.php
@@ -1,104 +1,106 @@
-<?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.
-*/
-
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/mail_box.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"],$_SESSION["s"]["module"]["name"])) {
- 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;
-
- $email = $this->dataRecord["email"];
- $email_parts = explode("@",$email);
- $app->tpl->setVar("email_local_part",$email_parts[0]);
-
- // Getting Domains of the user
- $sql = "SELECT domain FROM mail_domain WHERE type = 'local' AND ".$app->tform->getAuthSQL('r');
- $domains = $app->db->queryAllRecords($sql);
- $domain_select = '';
- foreach( $domains as $domain) {
- $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':'';
- $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
- }
- $app->tpl->setVar("email_domain",$domain_select);
-
- parent::onShowEnd();
- }
-
- function onSubmit() {
- global $app, $conf;
-
- // Check if Domain belongs to user
- $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
- if($domain["domain"] != $_POST["email_domain"]) $app->tform->errorMessage .= $app->tform->wordbook["no_domain_perm"];
-
- // if its an insert, check for password
- if($this->id == 0 and $_POST["cryptpwd"] == '') {
- $app->tform->errorMessage .= $app->tform->wordbook["error_no_pwd"]."<br>";
- }
-
- // compose the email field
- $this->dataRecord["email"] = $_POST["email_local_part"]."@".$_POST["email_domain"];
- // Set the server id of the mailbox = server ID of mail domain.
- $this->dataRecord["server_id"] = $domain["server_id"];
-
- unset($this->dataRecord["email_local_part"]);
- unset($this->dataRecord["email_domain"]);
-
- parent::onSubmit();
- }
-
-}
-
-$app->tform_actions = new page_action;
-$app->tform_actions->onLoad();
-
+<?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.
+*/
+
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/mail_blacklist.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"],$_SESSION["s"]["module"]["name"])) {
+ 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;
+
+ // Getting recipient from data record
+ $recipient = $this->dataRecord["recipient"];
+ $email_parts = explode("@",$recipient);
+ $app->tpl->setVar("recipient_local_part",$email_parts[0]);
+
+ // Getting Domains of the user
+ $sql = "SELECT domain FROM mail_domain WHERE type = 'local' AND ".$app->tform->getAuthSQL('r');
+ $domains = $app->db->queryAllRecords($sql);
+ $domain_select = '';
+ if($_SESSION["s"]["user"]["typ"] == 'admin') $domain_select .= '<option value=""></option>';
+ foreach( $domains as $domain) {
+ $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':'';
+ $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
+ }
+ $app->tpl->setVar("recipient_domain",$domain_select);
+
+ parent::onShowEnd();
+ }
+
+ function onSubmit() {
+ global $app, $conf;
+
+ // Check if Domain belongs to user
+ $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM mail_domain WHERE domain = '".$app->db->quote($_POST["recipient_domain"])."' AND ".$app->tform->getAuthSQL('r'));
+ if($domain["domain"] != $_POST["recipient_domain"]) $app->tform->errorMessage .= $app->tform->wordbook["no_domain_perm"];
+
+ // compose the email field
+ if($_POST["recipient_local_part"] != '') {
+ $this->dataRecord["recipient"] = $_POST["recipient_local_part"]."@".$_POST["recipient_domain"];
+ } else {
+ $this->dataRecord["recipient"] = $_POST["recipient_domain"];
+ }
+ // Set the server id of the mailbox = server ID of mail domain.
+ //$this->dataRecord["server_id"] = $domain["server_id"];
+
+ unset($this->dataRecord["recipient_local_part"]);
+ unset($this->dataRecord["recipient_domain"]);
+
+ parent::onSubmit();
+ }
+
+}
+
+$app->tform_actions = new page_action;
+$app->tform_actions->onLoad();
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_blacklist_list.php b/interface/web/mail/mail_blacklist_list.php
similarity index 100%
rename from interface/web/sites/mail_blacklist_list.php
rename to interface/web/mail/mail_blacklist_list.php
diff --git a/interface/web/sites/mail_box_del.php b/interface/web/mail/mail_box_del.php
similarity index 100%
rename from interface/web/sites/mail_box_del.php
rename to interface/web/mail/mail_box_del.php
diff --git a/interface/web/sites/mail_box_edit.php b/interface/web/mail/mail_box_edit.php
similarity index 91%
rename from interface/web/sites/mail_box_edit.php
rename to interface/web/mail/mail_box_edit.php
index 4d007a7..a93d14a 100644
--- a/interface/web/sites/mail_box_edit.php
+++ b/interface/web/mail/mail_box_edit.php
@@ -1,104 +1,111 @@
-<?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.
-*/
-
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/mail_box.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"],$_SESSION["s"]["module"]["name"])) {
- 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;
-
- $email = $this->dataRecord["email"];
- $email_parts = explode("@",$email);
- $app->tpl->setVar("email_local_part",$email_parts[0]);
-
- // Getting Domains of the user
- $sql = "SELECT domain FROM mail_domain WHERE type = 'local' AND ".$app->tform->getAuthSQL('r');
- $domains = $app->db->queryAllRecords($sql);
- $domain_select = '';
- foreach( $domains as $domain) {
- $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':'';
- $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
- }
- $app->tpl->setVar("email_domain",$domain_select);
-
- parent::onShowEnd();
- }
-
- function onSubmit() {
- global $app, $conf;
-
- // Check if Domain belongs to user
- $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
- if($domain["domain"] != $_POST["email_domain"]) $app->tform->errorMessage .= $app->tform->wordbook["no_domain_perm"];
-
- // if its an insert, check for password
- if($this->id == 0 and $_POST["cryptpwd"] == '') {
- $app->tform->errorMessage .= $app->tform->wordbook["error_no_pwd"]."<br>";
- }
-
- // compose the email field
- $this->dataRecord["email"] = $_POST["email_local_part"]."@".$_POST["email_domain"];
- // Set the server id of the mailbox = server ID of mail domain.
- $this->dataRecord["server_id"] = $domain["server_id"];
-
- unset($this->dataRecord["email_local_part"]);
- unset($this->dataRecord["email_domain"]);
-
- parent::onSubmit();
- }
-
-}
-
-$app->tform_actions = new page_action;
-$app->tform_actions->onLoad();
-
+<?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.
+*/
+
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/mail_box.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"],$_SESSION["s"]["module"]["name"])) {
+ 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;
+
+ $email = $this->dataRecord["email"];
+ $email_parts = explode("@",$email);
+ $app->tpl->setVar("email_local_part",$email_parts[0]);
+
+ // Getting Domains of the user
+ $sql = "SELECT domain FROM mail_domain WHERE type = 'local' AND ".$app->tform->getAuthSQL('r');
+ $domains = $app->db->queryAllRecords($sql);
+ $domain_select = '';
+ foreach( $domains as $domain) {
+ $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':'';
+ $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
+ }
+ $app->tpl->setVar("email_domain",$domain_select);
+
+ parent::onShowEnd();
+ }
+
+ function onSubmit() {
+ global $app, $conf;
+
+ // Check if Domain belongs to user
+ $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
+ if($domain["domain"] != $_POST["email_domain"]) $app->tform->errorMessage .= $app->tform->wordbook["no_domain_perm"];
+
+ // if its an insert, check for password
+ if($this->id == 0 and $_POST["cryptpwd"] == '') {
+ $app->tform->errorMessage .= $app->tform->wordbook["error_no_pwd"]."<br>";
+ }
+
+ // compose the email field
+ $this->dataRecord["email"] = $_POST["email_local_part"]."@".$_POST["email_domain"];
+ // Set the server id of the mailbox = server ID of mail domain.
+ $this->dataRecord["server_id"] = $domain["server_id"];
+
+ unset($this->dataRecord["email_local_part"]);
+ unset($this->dataRecord["email_domain"]);
+
+ // setting Maildir
+ $app->uses('getconf');
+ $mail_config = $app->getconf->get_server_config($domain["server_id"],'mail');
+ $maildir = str_replace("[domain]",$domain["domain"],$mail_config["maildir_path"]);
+ $maildir = str_replace("[localpart]",$_POST["email_local_part"],$maildir);
+ $this->dataRecord["maildir"] = $maildir;
+
+ parent::onSubmit();
+ }
+
+}
+
+$app->tform_actions = new page_action;
+$app->tform_actions->onLoad();
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_box_list.php b/interface/web/mail/mail_box_list.php
similarity index 100%
rename from interface/web/sites/mail_box_list.php
rename to interface/web/mail/mail_box_list.php
diff --git a/interface/web/sites/mail_domain_alias_del.php b/interface/web/mail/mail_domain_alias_del.php
similarity index 100%
rename from interface/web/sites/mail_domain_alias_del.php
rename to interface/web/mail/mail_domain_alias_del.php
diff --git a/interface/web/sites/mail_domain_alias_edit.php b/interface/web/mail/mail_domain_alias_edit.php
similarity index 100%
rename from interface/web/sites/mail_domain_alias_edit.php
rename to interface/web/mail/mail_domain_alias_edit.php
diff --git a/interface/web/sites/mail_domain_alias_list.php b/interface/web/mail/mail_domain_alias_list.php
similarity index 100%
rename from interface/web/sites/mail_domain_alias_list.php
rename to interface/web/mail/mail_domain_alias_list.php
diff --git a/interface/web/sites/mail_domain_catchall_del.php b/interface/web/mail/mail_domain_catchall_del.php
similarity index 100%
rename from interface/web/sites/mail_domain_catchall_del.php
rename to interface/web/mail/mail_domain_catchall_del.php
diff --git a/interface/web/sites/mail_domain_catchall_edit.php b/interface/web/mail/mail_domain_catchall_edit.php
similarity index 100%
rename from interface/web/sites/mail_domain_catchall_edit.php
rename to interface/web/mail/mail_domain_catchall_edit.php
diff --git a/interface/web/sites/mail_domain_catchall_list.php b/interface/web/mail/mail_domain_catchall_list.php
similarity index 100%
rename from interface/web/sites/mail_domain_catchall_list.php
rename to interface/web/mail/mail_domain_catchall_list.php
diff --git a/interface/web/sites/mail_domain_del.php b/interface/web/mail/mail_domain_del.php
similarity index 100%
rename from interface/web/sites/mail_domain_del.php
rename to interface/web/mail/mail_domain_del.php
diff --git a/interface/web/sites/mail_domain_edit.php b/interface/web/mail/mail_domain_edit.php
similarity index 100%
rename from interface/web/sites/mail_domain_edit.php
rename to interface/web/mail/mail_domain_edit.php
diff --git a/interface/web/sites/mail_domain_list.php b/interface/web/mail/mail_domain_list.php
similarity index 100%
rename from interface/web/sites/mail_domain_list.php
rename to interface/web/mail/mail_domain_list.php
diff --git a/interface/web/sites/mail_domain_relay_del.php b/interface/web/mail/mail_domain_relay_del.php
similarity index 100%
rename from interface/web/sites/mail_domain_relay_del.php
rename to interface/web/mail/mail_domain_relay_del.php
diff --git a/interface/web/sites/mail_domain_relay_edit.php b/interface/web/mail/mail_domain_relay_edit.php
similarity index 100%
rename from interface/web/sites/mail_domain_relay_edit.php
rename to interface/web/mail/mail_domain_relay_edit.php
diff --git a/interface/web/sites/mail_domain_relay_list.php b/interface/web/mail/mail_domain_relay_list.php
similarity index 100%
rename from interface/web/sites/mail_domain_relay_list.php
rename to interface/web/mail/mail_domain_relay_list.php
diff --git a/interface/web/sites/mail_blacklist_edit.php b/interface/web/mail/mail_domain_route_del.php
similarity index 90%
copy from interface/web/sites/mail_blacklist_edit.php
copy to interface/web/mail/mail_domain_route_del.php
index e72f28c..d69f9e2 100644
--- a/interface/web/sites/mail_blacklist_edit.php
+++ b/interface/web/mail/mail_domain_route_del.php
@@ -1,4 +1,5 @@
<?php
+
/*
Copyright (c) 2005, Till Brehm, projektfarm Gmbh
All rights reserved.
@@ -27,12 +28,12 @@
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
/******************************************
* Begin Form configuration
******************************************/
-$tform_def_file = "form/mail_blacklist.tform.php";
+$list_def_file = "list/mail_domain_route.list.php";
+$tform_def_file = "form/mail_domain_route.tform.php";
/******************************************
* End Form configuration
@@ -41,15 +42,13 @@
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
-// Checking module permissions
+// Checke Berechtigungen f�r Modul
if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
header("Location: ../index.php");
exit;
}
-// Loading classes
-$app->uses('tpl,tform,tform_actions');
-$app->tform_actions->onLoad();
-
+$app->uses("tform_actions");
+$app->tform_actions->onDelete();
?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_blacklist_edit.php b/interface/web/mail/mail_domain_route_edit.php
similarity index 95%
rename from interface/web/sites/mail_blacklist_edit.php
rename to interface/web/mail/mail_domain_route_edit.php
index e72f28c..a87a8ae 100644
--- a/interface/web/sites/mail_blacklist_edit.php
+++ b/interface/web/mail/mail_domain_route_edit.php
@@ -32,7 +32,7 @@
* Begin Form configuration
******************************************/
-$tform_def_file = "form/mail_blacklist.tform.php";
+$tform_def_file = "form/mail_domain_route.tform.php";
/******************************************
* End Form configuration
@@ -49,7 +49,8 @@
// Loading classes
$app->uses('tpl,tform,tform_actions');
-$app->tform_actions->onLoad();
+// let tform_actions handle the page
+$app->tform_actions->onLoad();
?>
\ No newline at end of file
diff --git a/interface/web/mail/mail_domain_route_list.php b/interface/web/mail/mail_domain_route_list.php
new file mode 100644
index 0000000..c7f004f
--- /dev/null
+++ b/interface/web/mail/mail_domain_route_list.php
@@ -0,0 +1,30 @@
+<?php
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$list_def_file = "list/mail_domain_route.list.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+// Checking module permissions
+if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
+ header("Location: ../index.php");
+ exit;
+}
+
+$app->uses('listform_actions');
+
+// Limit the results to alias domains
+$app->listform_actions->SQLExtWhere = "";
+
+// Generate the page
+$app->listform_actions->onLoad();
+
+
+?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_forward_del.php b/interface/web/mail/mail_forward_del.php
similarity index 100%
rename from interface/web/sites/mail_forward_del.php
rename to interface/web/mail/mail_forward_del.php
diff --git a/interface/web/sites/mail_forward_edit.php b/interface/web/mail/mail_forward_edit.php
similarity index 100%
rename from interface/web/sites/mail_forward_edit.php
rename to interface/web/mail/mail_forward_edit.php
diff --git a/interface/web/sites/mail_forward_list.php b/interface/web/mail/mail_forward_list.php
similarity index 100%
rename from interface/web/sites/mail_forward_list.php
rename to interface/web/mail/mail_forward_list.php
diff --git a/interface/web/sites/mail_blacklist_edit.php b/interface/web/mail/mail_spamfilter_del.php
similarity index 90%
copy from interface/web/sites/mail_blacklist_edit.php
copy to interface/web/mail/mail_spamfilter_del.php
index e72f28c..a6985ef 100644
--- a/interface/web/sites/mail_blacklist_edit.php
+++ b/interface/web/mail/mail_spamfilter_del.php
@@ -1,55 +1,54 @@
-<?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.
-*/
-
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/mail_blacklist.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"],$_SESSION["s"]["module"]["name"])) {
- header("Location: ../index.php");
- exit;
-}
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions');
-$app->tform_actions->onLoad();
-
-
+<?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.
+*/
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$list_def_file = "list/mail_spamfilter.list.php";
+$tform_def_file = "form/mail_spamfilter.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"],$_SESSION["s"]["module"]["name"])) {
+ header("Location: ../index.php");
+ exit;
+}
+
+$app->uses("tform_actions");
+$app->tform_actions->onDelete();
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_box_edit.php b/interface/web/mail/mail_spamfilter_edit.php
similarity index 68%
copy from interface/web/sites/mail_box_edit.php
copy to interface/web/mail/mail_spamfilter_edit.php
index 4d007a7..2c3766a 100644
--- a/interface/web/sites/mail_box_edit.php
+++ b/interface/web/mail/mail_spamfilter_edit.php
@@ -1,104 +1,127 @@
-<?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.
-*/
-
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/mail_box.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"],$_SESSION["s"]["module"]["name"])) {
- 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;
-
- $email = $this->dataRecord["email"];
- $email_parts = explode("@",$email);
- $app->tpl->setVar("email_local_part",$email_parts[0]);
-
- // Getting Domains of the user
- $sql = "SELECT domain FROM mail_domain WHERE type = 'local' AND ".$app->tform->getAuthSQL('r');
- $domains = $app->db->queryAllRecords($sql);
- $domain_select = '';
- foreach( $domains as $domain) {
- $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':'';
- $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
- }
- $app->tpl->setVar("email_domain",$domain_select);
-
- parent::onShowEnd();
- }
-
- function onSubmit() {
- global $app, $conf;
-
- // Check if Domain belongs to user
- $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
- if($domain["domain"] != $_POST["email_domain"]) $app->tform->errorMessage .= $app->tform->wordbook["no_domain_perm"];
-
- // if its an insert, check for password
- if($this->id == 0 and $_POST["cryptpwd"] == '') {
- $app->tform->errorMessage .= $app->tform->wordbook["error_no_pwd"]."<br>";
- }
-
- // compose the email field
- $this->dataRecord["email"] = $_POST["email_local_part"]."@".$_POST["email_domain"];
- // Set the server id of the mailbox = server ID of mail domain.
- $this->dataRecord["server_id"] = $domain["server_id"];
-
- unset($this->dataRecord["email_local_part"]);
- unset($this->dataRecord["email_domain"]);
-
- parent::onSubmit();
- }
-
-}
-
-$app->tform_actions = new page_action;
-$app->tform_actions->onLoad();
-
+<?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.
+*/
+
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/mail_spamfilter.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"],$_SESSION["s"]["module"]["name"])) {
+ 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;
+
+ // Getting email from data record
+ $email = $this->dataRecord["email"];
+ $email_parts = explode("@",$email);
+ $app->tpl->setVar("email_local_part",$email_parts[0]);
+
+ // Getting Domains of the user
+ $sql = "SELECT domain FROM mail_domain WHERE type = 'local' AND ".$app->tform->getAuthSQL('r');
+ $domains = $app->db->queryAllRecords($sql);
+ $domain_select = '';
+ foreach( $domains as $domain) {
+ $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':'';
+ $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
+ }
+ $app->tpl->setVar("email_domain",$domain_select);
+
+ // calculate scores
+ if(count($this->dataRecord) > 0) {
+ $app->tpl->setVar("spam_rewrite_score_int",number_format($this->dataRecord["spam_rewrite_score_int"] / 100, 2, '.', ''));
+ $app->tpl->setVar("spam_redirect_score_int",number_format($this->dataRecord["spam_redirect_score_int"] / 100, 2, '.', ''));
+ $app->tpl->setVar("spam_delete_score_int",number_format($this->dataRecord["spam_delete_score_int"] / 100, 2, '.', ''));
+ }
+
+ // Changing maildir to mailbox_id
+ $sql = "SELECT mailbox_id FROM mail_box WHERE maildir = '".$this->dataRecord["spam_redirect_maildir"]."' AND ".$app->tform->getAuthSQL('r');
+ $mailbox = $app->db->queryOneRecord($sql);
+ $this->dataRecord["spam_redirect_maildir"] = $mailbox["mailbox_id"];
+
+ parent::onShowEnd();
+ }
+
+ function onSubmit() {
+ global $app, $conf;
+
+ // Check if Domain belongs to user
+ $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
+ if($domain["domain"] != $_POST["email_domain"]) $app->tform->errorMessage .= $app->tform->wordbook["no_domain_perm"];
+
+ // compose the email field
+ if($_POST["email_local_part"] != '') {
+ $this->dataRecord["email"] = $_POST["email_local_part"]."@".$_POST["email_domain"];
+ } else {
+ $this->dataRecord["email"] = $_POST["email_domain"];
+ }
+ // Set the server id of the mailbox = server ID of mail domain.
+ $this->dataRecord["server_id"] = $domain["server_id"];
+
+ unset($this->dataRecord["email_local_part"]);
+ unset($this->dataRecord["email_domain"]);
+
+ // calculate scores
+ $this->dataRecord["spam_rewrite_score_int"] = $_POST["spam_rewrite_score_int"] * 100;
+ $this->dataRecord["spam_redirect_score_int"] = $_POST["spam_redirect_score_int"] * 100;
+ $this->dataRecord["spam_delete_score_int"] = $_POST["spam_delete_score_int"] * 100;
+
+ // Changing mailbox_id to maildir
+ $sql = "SELECT maildir FROM mail_box WHERE mailbox_id = '".intval($_POST["spam_redirect_maildir"])."' AND ".$app->tform->getAuthSQL('r');
+ $mailbox = $app->db->queryOneRecord($sql);
+ $this->dataRecord["spam_redirect_maildir"] = $mailbox["maildir"];
+
+ parent::onSubmit();
+ }
+
+}
+
+$app->tform_actions = new page_action;
+$app->tform_actions->onLoad();
+
+
?>
\ No newline at end of file
diff --git a/interface/web/mail/mail_spamfilter_list.php b/interface/web/mail/mail_spamfilter_list.php
new file mode 100644
index 0000000..e510589
--- /dev/null
+++ b/interface/web/mail/mail_spamfilter_list.php
@@ -0,0 +1,26 @@
+<?php
+require_once('../../lib/config.inc.php');
+require_once('../../lib/app.inc.php');
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$list_def_file = "list/mail_spamfilter.list.php";
+
+/******************************************
+* End Form configuration
+******************************************/
+
+// Checking module permissions
+if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
+ header("Location: ../index.php");
+ exit;
+}
+
+$app->uses('listform_actions');
+
+$app->listform_actions->onLoad();
+
+
+?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_whitelist_del.php b/interface/web/mail/mail_whitelist_del.php
similarity index 100%
rename from interface/web/sites/mail_whitelist_del.php
rename to interface/web/mail/mail_whitelist_del.php
diff --git a/interface/web/sites/mail_box_edit.php b/interface/web/mail/mail_whitelist_edit.php
similarity index 74%
copy from interface/web/sites/mail_box_edit.php
copy to interface/web/mail/mail_whitelist_edit.php
index 4d007a7..ece39d5 100644
--- a/interface/web/sites/mail_box_edit.php
+++ b/interface/web/mail/mail_whitelist_edit.php
@@ -1,104 +1,106 @@
-<?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.
-*/
-
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/mail_box.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"],$_SESSION["s"]["module"]["name"])) {
- 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;
-
- $email = $this->dataRecord["email"];
- $email_parts = explode("@",$email);
- $app->tpl->setVar("email_local_part",$email_parts[0]);
-
- // Getting Domains of the user
- $sql = "SELECT domain FROM mail_domain WHERE type = 'local' AND ".$app->tform->getAuthSQL('r');
- $domains = $app->db->queryAllRecords($sql);
- $domain_select = '';
- foreach( $domains as $domain) {
- $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':'';
- $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
- }
- $app->tpl->setVar("email_domain",$domain_select);
-
- parent::onShowEnd();
- }
-
- function onSubmit() {
- global $app, $conf;
-
- // Check if Domain belongs to user
- $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM mail_domain WHERE domain = '".$app->db->quote($_POST["email_domain"])."' AND ".$app->tform->getAuthSQL('r'));
- if($domain["domain"] != $_POST["email_domain"]) $app->tform->errorMessage .= $app->tform->wordbook["no_domain_perm"];
-
- // if its an insert, check for password
- if($this->id == 0 and $_POST["cryptpwd"] == '') {
- $app->tform->errorMessage .= $app->tform->wordbook["error_no_pwd"]."<br>";
- }
-
- // compose the email field
- $this->dataRecord["email"] = $_POST["email_local_part"]."@".$_POST["email_domain"];
- // Set the server id of the mailbox = server ID of mail domain.
- $this->dataRecord["server_id"] = $domain["server_id"];
-
- unset($this->dataRecord["email_local_part"]);
- unset($this->dataRecord["email_domain"]);
-
- parent::onSubmit();
- }
-
-}
-
-$app->tform_actions = new page_action;
-$app->tform_actions->onLoad();
-
+<?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.
+*/
+
+
+/******************************************
+* Begin Form configuration
+******************************************/
+
+$tform_def_file = "form/mail_whitelist.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"],$_SESSION["s"]["module"]["name"])) {
+ 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;
+
+ // Getting recipient from data record
+ $recipient = $this->dataRecord["recipient"];
+ $email_parts = explode("@",$recipient);
+ $app->tpl->setVar("recipient_local_part",$email_parts[0]);
+
+ // Getting Domains of the user
+ $sql = "SELECT domain FROM mail_domain WHERE type = 'local' AND ".$app->tform->getAuthSQL('r');
+ $domains = $app->db->queryAllRecords($sql);
+ $domain_select = '';
+ if($_SESSION["s"]["user"]["typ"] == 'admin') $domain_select .= '<option value=""></option>';
+ foreach( $domains as $domain) {
+ $selected = ($domain["domain"] == $email_parts[1])?'SELECTED':'';
+ $domain_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
+ }
+ $app->tpl->setVar("recipient_domain",$domain_select);
+
+ parent::onShowEnd();
+ }
+
+ function onSubmit() {
+ global $app, $conf;
+
+ // Check if Domain belongs to user
+ $domain = $app->db->queryOneRecord("SELECT server_id, domain FROM mail_domain WHERE domain = '".$app->db->quote($_POST["recipient_domain"])."' AND ".$app->tform->getAuthSQL('r'));
+ if($domain["domain"] != $_POST["recipient_domain"]) $app->tform->errorMessage .= $app->tform->wordbook["no_domain_perm"];
+
+ // compose the email field
+ if($_POST["recipient_local_part"] != '') {
+ $this->dataRecord["recipient"] = $_POST["recipient_local_part"]."@".$_POST["recipient_domain"];
+ } else {
+ $this->dataRecord["recipient"] = $_POST["recipient_domain"];
+ }
+ // Set the server id of the mailbox = server ID of mail domain.
+ // $this->dataRecord["server_id"] = $domain["server_id"];
+
+ unset($this->dataRecord["recipient_local_part"]);
+ unset($this->dataRecord["recipient_domain"]);
+
+ parent::onSubmit();
+ }
+
+}
+
+$app->tform_actions = new page_action;
+$app->tform_actions->onLoad();
+
+
?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_whitelist_list.php b/interface/web/mail/mail_whitelist_list.php
similarity index 100%
rename from interface/web/sites/mail_whitelist_list.php
rename to interface/web/mail/mail_whitelist_list.php
diff --git a/interface/web/sites/templates/mail_alias_edit.htm b/interface/web/mail/templates/mail_alias_edit.htm
similarity index 100%
rename from interface/web/sites/templates/mail_alias_edit.htm
rename to interface/web/mail/templates/mail_alias_edit.htm
diff --git a/interface/web/sites/templates/mail_alias_list.htm b/interface/web/mail/templates/mail_alias_list.htm
similarity index 100%
rename from interface/web/sites/templates/mail_alias_list.htm
rename to interface/web/mail/templates/mail_alias_list.htm
diff --git a/interface/web/sites/templates/mail_blacklist_edit.htm b/interface/web/mail/templates/mail_blacklist_edit.htm
similarity index 76%
rename from interface/web/sites/templates/mail_blacklist_edit.htm
rename to interface/web/mail/templates/mail_blacklist_edit.htm
index 774a29c..dab389a 100644
--- a/interface/web/sites/templates/mail_blacklist_edit.htm
+++ b/interface/web/mail/templates/mail_blacklist_edit.htm
@@ -1,28 +1,32 @@
-<table width="500" border="0" cellspacing="0" cellpadding="2">
- <tr>
- <td width="126" class="frmText11">{tmpl_var name='server_id_txt'}:</td>
- <td width="366" class="frmText11">
- <select name="server_id" class="text">
- {tmpl_var name='server_id'}
- </select>
- </td>
- </tr>
- <tr>
- <td width="126" class="frmText11">{tmpl_var name='address_txt'}:</td>
- <td width="366" class="frmText11"><input name="address" type="text" class="text" value="{tmpl_var name='address'}" size="30" maxlength="255"></td>
- </tr>
- <tr>
- <td width="126" class="frmText11">{tmpl_var name='active_txt'}:</td>
- <td width="366" class="frmText11">{tmpl_var name='active'}</td>
- </tr> <tr>
- <td class="frmText11"> </td>
- <td class="frmText11"> </td>
- </tr>
- <tr>
- <td> </td>
- <td><input name="btn_save" type="submit" class="button" value="{tmpl_var name='btn_save_txt'}">
- <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="self.location.href='mail_blacklist_list.php';">
- </td>
- </tr>
-</table>
+<table width="500" border="0" cellspacing="0" cellpadding="2">
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='server_id_txt'}:</td>
+ <td width="366" class="frmText11">
+ <select name="server_id" class="text">
+ {tmpl_var name='server_id'}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='address_txt'}:</td>
+ <td width="366" class="frmText11"><input name="address" type="text" class="text" value="{tmpl_var name='address'}" size="30" maxlength="255"></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='recipient_txt'}:</td>
+ <td width="366" class="frmText11"><input name="recipient_local_part" type="text" class="text" value="{tmpl_var name='recipient_local_part'}" size="10" maxlength="50"> @ <select name="recipient_domain">{tmpl_var name="recipient_domain"}</select></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='active_txt'}:</td>
+ <td width="366" class="frmText11">{tmpl_var name='active'}</td>
+ </tr> <tr>
+ <td class="frmText11"> </td>
+ <td class="frmText11"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td><input name="btn_save" type="submit" class="button" value="{tmpl_var name='btn_save_txt'}">
+ <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="self.location.href='mail_blacklist_list.php';">
+ </td>
+ </tr>
+</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
\ No newline at end of file
diff --git a/interface/web/mail/templates/mail_blacklist_list.htm b/interface/web/mail/templates/mail_blacklist_list.htm
new file mode 100644
index 0000000..1d2ec6c
--- /dev/null
+++ b/interface/web/mail/templates/mail_blacklist_list.htm
@@ -0,0 +1,32 @@
+<form name="myform" action="mail_blacklist_list.php" method="POST">
+<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
+<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_blacklist_edit.php'" /><br /><br />
+<table width="100%" border="0" cellspacing="0" cellpadding="4">
+ <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="address_txt"></td>
+ <td class="tblHead"><tmpl_var name="recipient_txt"></td>
+ <td class="tblHead"> </td>
+ </tr>
+ <tr>
+ <td class="frmText11"><select name="search_active" onChange="document.myform.submit();">{tmpl_var name='search_active'}</select></td>
+ <td class="frmText11"><select name="search_server_id" onChange="document.myform.submit();">{tmpl_var name='search_server_id'}</select></td>
+ <td class="frmText11"><input type="text" name="search_address" value="{tmpl_var name='search_address'}" class="text" /></td>
+ <td class="frmText11"><input type="text" name="search_recipient" value="{tmpl_var name='search_recipient'}" class="text" /></td>
+ <td class="frmText11" align="right"><input name="Filter" type="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
+ </tr>
+ <tmpl_loop name="records">
+ <tr bgcolor="{tmpl_var name="bgcolor"}">
+ <td class="frmText11"><a href="mail_blacklist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="active"}</a></td>
+ <td class="frmText11"><a href="mail_blacklist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
+ <td class="frmText11"><a href="mail_blacklist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="address"}</a></td>
+ <td class="frmText11"><a href="mail_blacklist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="recipient"}</a></td>
+ <td class="frmText11" align="right">[<a href="javascript: del_record('mail_blacklist_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>
+</form>
\ No newline at end of file
diff --git a/interface/web/sites/templates/mail_box_autoresponder_edit.htm b/interface/web/mail/templates/mail_box_autoresponder_edit.htm
similarity index 100%
rename from interface/web/sites/templates/mail_box_autoresponder_edit.htm
rename to interface/web/mail/templates/mail_box_autoresponder_edit.htm
diff --git a/interface/web/sites/templates/mail_box_list.htm b/interface/web/mail/templates/mail_box_list.htm
similarity index 100%
rename from interface/web/sites/templates/mail_box_list.htm
rename to interface/web/mail/templates/mail_box_list.htm
diff --git a/interface/web/sites/templates/mail_box_mailbox_edit.htm b/interface/web/mail/templates/mail_box_mailbox_edit.htm
similarity index 84%
rename from interface/web/sites/templates/mail_box_mailbox_edit.htm
rename to interface/web/mail/templates/mail_box_mailbox_edit.htm
index 1466e17..8cf7356 100644
--- a/interface/web/sites/templates/mail_box_mailbox_edit.htm
+++ b/interface/web/mail/templates/mail_box_mailbox_edit.htm
@@ -1,24 +1,28 @@
-<table width="500" border="0" cellspacing="0" cellpadding="2">
- <tr>
- <td width="126" class="frmText11">{tmpl_var name='email_txt'}:</td>
- <td width="366" class="frmText11"><input name="email_local_part" type="text" class="text" value="{tmpl_var name='email_local_part'}" size="10" maxlength="50"> @ <select name="email_domain">{tmpl_var name="email_domain"}</select></td>
- </tr>
- <tr>
- <td width="126" class="frmText11">{tmpl_var name='cryptpwd_txt'}:</td>
- <td width="366" class="frmText11"><input name="cryptpwd" type="password" class="text" value="{tmpl_var name='cryptpwd'}" size="25" maxlength="255"></td>
- </tr>
- <tr>
- <td width="126" class="frmText11">{tmpl_var name='active_txt'}:</td>
- <td width="366" class="frmText11">{tmpl_var name='active'}</td>
- </tr> <tr>
- <td class="frmText11"> </td>
- <td class="frmText11"> </td>
- </tr>
- <tr>
- <td> </td>
- <td><input name="btn_save" type="submit" class="button" value="{tmpl_var name='btn_save_txt'}">
- <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="self.location.href='mail_box_list.php';">
- </td>
- </tr>
-</table>
+<table width="500" border="0" cellspacing="0" cellpadding="2">
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='email_txt'}:</td>
+ <td width="366" class="frmText11"><input name="email_local_part" type="text" class="text" value="{tmpl_var name='email_local_part'}" size="10" maxlength="50"> @ <select name="email_domain">{tmpl_var name="email_domain"}</select></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='cryptpwd_txt'}:</td>
+ <td width="366" class="frmText11"><input name="cryptpwd" type="password" class="text" value="{tmpl_var name='cryptpwd'}" size="25" maxlength="255"></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='quota_txt'}:</td>
+ <td width="366" class="frmText11"><input name="quota" type="text" class="text" value="{tmpl_var name='quota'}" size="5" maxlength="5"> MB</td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='active_txt'}:</td>
+ <td width="366" class="frmText11">{tmpl_var name='active'}</td>
+ </tr> <tr>
+ <td class="frmText11"> </td>
+ <td class="frmText11"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td><input name="btn_save" type="submit" class="button" value="{tmpl_var name='btn_save_txt'}">
+ <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="self.location.href='mail_box_list.php';">
+ </td>
+ </tr>
+</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
\ No newline at end of file
diff --git a/interface/web/sites/templates/mail_domain_alias_edit.htm b/interface/web/mail/templates/mail_domain_alias_edit.htm
similarity index 100%
rename from interface/web/sites/templates/mail_domain_alias_edit.htm
rename to interface/web/mail/templates/mail_domain_alias_edit.htm
diff --git a/interface/web/sites/templates/mail_domain_alias_list.htm b/interface/web/mail/templates/mail_domain_alias_list.htm
similarity index 70%
rename from interface/web/sites/templates/mail_domain_alias_list.htm
rename to interface/web/mail/templates/mail_domain_alias_list.htm
index f5b2145..8bdbe33 100644
--- a/interface/web/sites/templates/mail_domain_alias_list.htm
+++ b/interface/web/mail/templates/mail_domain_alias_list.htm
@@ -1,30 +1,33 @@
-<form name="myform" action="mail_domain_alias_list.php" method="POST">
-<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
-<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_domain_alias_edit.php'" /><br /><br />
-<table width="100%" border="0" cellspacing="0" cellpadding="4">
- <tr>
- <td class="tblHead"><tmpl_var name="server_id_txt"></td>
- <td class="tblHead"><tmpl_var name="domain_txt"></td>
- <td class="tblHead"><tmpl_var name="destination_txt"></td>
- <td class="tblHead"> </td>
- </tr>
- <tr>
- <td class="frmText11"><input type="text" name="search_server_id" value="{tmpl_var name='search_server_id'}" class="text" /></td>
- <td class="frmText11"><input type="text" name="search_domain" value="{tmpl_var name='search_domain'}" class="text" /></td>
- <td class="frmText11"><input type="text" name="search_destination" value="{tmpl_var name='search_destination'}" class="text" /></td>
- <td class="frmText11" align="right"><input name="Filter" type="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
- </tr>
- <tmpl_loop name="records">
- <tr bgcolor="{tmpl_var name="bgcolor"}">
- <td class="frmText11"><a href="mail_domain_alias_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
- <td class="frmText11"><a href="mail_domain_alias_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="domain"}</a></td>
- <td class="frmText11"><a href="mail_domain_alias_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="destination"}</a></td>
- <td class="frmText11" align="right">[<a href="javascript: del_record('mail_domain_alias_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>
+<form name="myform" action="mail_domain_alias_list.php" method="POST">
+<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
+<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_domain_alias_edit.php'" /><br /><br />
+<table width="100%" border="0" cellspacing="0" cellpadding="4">
+ <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"><tmpl_var name="destination_txt"></td>
+ <td class="tblHead"> </td>
+ </tr>
+ <tr>
+ <td class="frmText11"><select name="search_active" onChange="document.myform.submit();">{tmpl_var name='search_active'}</select></td>
+ <td class="frmText11"><select name="search_server_id" onChange="document.myform.submit();">{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"><input type="text" name="search_destination" value="{tmpl_var name='search_destination'}" class="text" /></td>
+ <td class="frmText11" align="right"><input name="Filter" type="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
+ </tr>
+ <tmpl_loop name="records">
+ <tr bgcolor="{tmpl_var name="bgcolor"}">
+ <td class="frmText11"><a href="mail_domain_alias_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="active"}</a></td>
+ <td class="frmText11"><a href="mail_domain_alias_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
+ <td class="frmText11"><a href="mail_domain_alias_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="domain"}</a></td>
+ <td class="frmText11"><a href="mail_domain_alias_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="destination"}</a></td>
+ <td class="frmText11" align="right">[<a href="javascript: del_record('mail_domain_alias_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>
</form>
\ No newline at end of file
diff --git a/interface/web/sites/templates/mail_domain_catchall_edit.htm b/interface/web/mail/templates/mail_domain_catchall_edit.htm
similarity index 100%
rename from interface/web/sites/templates/mail_domain_catchall_edit.htm
rename to interface/web/mail/templates/mail_domain_catchall_edit.htm
diff --git a/interface/web/sites/templates/mail_domain_catchall_list.htm b/interface/web/mail/templates/mail_domain_catchall_list.htm
similarity index 71%
rename from interface/web/sites/templates/mail_domain_catchall_list.htm
rename to interface/web/mail/templates/mail_domain_catchall_list.htm
index c2b5f6d..5ade0ad 100644
--- a/interface/web/sites/templates/mail_domain_catchall_list.htm
+++ b/interface/web/mail/templates/mail_domain_catchall_list.htm
@@ -1,30 +1,33 @@
-<form name="myform" action="mail_domain_catchall_list.php" method="POST">
-<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
-<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_domain_catchall_edit.php'" /><br /><br />
-<table width="100%" border="0" cellspacing="0" cellpadding="4">
- <tr>
- <td class="tblHead"><tmpl_var name="server_id_txt"></td>
- <td class="tblHead"><tmpl_var name="domain_txt"></td>
- <td class="tblHead"><tmpl_var name="destination_txt"></td>
- <td class="tblHead"> </td>
- </tr>
- <tr>
- <td class="frmText11"><input type="text" name="search_server_id" value="{tmpl_var name='search_server_id'}" class="text" /></td>
- <td class="frmText11"><input type="text" name="search_domain" value="{tmpl_var name='search_domain'}" class="text" /></td>
- <td class="frmText11"><input type="text" name="search_destination" value="{tmpl_var name='search_destination'}" class="text" /></td>
- <td class="frmText11" align="right"><input name="Filter" type="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
- </tr>
- <tmpl_loop name="records">
- <tr bgcolor="{tmpl_var name="bgcolor"}">
- <td class="frmText11"><a href="mail_domain_catchall_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
- <td class="frmText11"><a href="mail_domain_catchall_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="domain"}</a></td>
- <td class="frmText11"><a href="mail_domain_catchall_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="destination"}</a></td>
- <td class="frmText11" align="right">[<a href="javascript: del_record('mail_domain_catchall_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>
+<form name="myform" action="mail_domain_catchall_list.php" method="POST">
+<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
+<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_domain_catchall_edit.php'" /><br /><br />
+<table width="100%" border="0" cellspacing="0" cellpadding="4">
+ <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"><tmpl_var name="destination_txt"></td>
+ <td class="tblHead"> </td>
+ </tr>
+ <tr>
+ <td class="frmText11"><select name="search_active" onChange="document.myform.submit();">{tmpl_var name='search_active'}</select></td>
+ <td class="frmText11"><input type="text" name="search_server_id" value="{tmpl_var name='search_server_id'}" class="text" /></td>
+ <td class="frmText11"><input type="text" name="search_domain" value="{tmpl_var name='search_domain'}" class="text" /></td>
+ <td class="frmText11"><input type="text" name="search_destination" value="{tmpl_var name='search_destination'}" class="text" /></td>
+ <td class="frmText11" align="right"><input name="Filter" type="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
+ </tr>
+ <tmpl_loop name="records">
+ <tr bgcolor="{tmpl_var name="bgcolor"}">
+ <td class="frmText11"><a href="mail_domain_catchall_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="active"}</a></td>
+ <td class="frmText11"><a href="mail_domain_catchall_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
+ <td class="frmText11"><a href="mail_domain_catchall_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="domain"}</a></td>
+ <td class="frmText11"><a href="mail_domain_catchall_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="destination"}</a></td>
+ <td class="frmText11" align="right">[<a href="javascript: del_record('mail_domain_catchall_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>
</form>
\ No newline at end of file
diff --git a/interface/web/sites/templates/mail_domain_edit.htm b/interface/web/mail/templates/mail_domain_edit.htm
similarity index 100%
rename from interface/web/sites/templates/mail_domain_edit.htm
rename to interface/web/mail/templates/mail_domain_edit.htm
diff --git a/interface/web/sites/templates/mail_domain_list.htm b/interface/web/mail/templates/mail_domain_list.htm
similarity index 65%
rename from interface/web/sites/templates/mail_domain_list.htm
rename to interface/web/mail/templates/mail_domain_list.htm
index 93e7d1a..79c0958 100644
--- a/interface/web/sites/templates/mail_domain_list.htm
+++ b/interface/web/mail/templates/mail_domain_list.htm
@@ -1,26 +1,29 @@
-<form name="myform" action="mail_domain_list.php" method="POST">
-<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
-<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_domain_edit.php'" /><br /><br />
-<table width="100%" border="0" cellspacing="0" cellpadding="4">
- <tr>
- <td class="tblHead"><tmpl_var name="server_id_txt"></td>
- <td class="tblHead"><tmpl_var name="domain_txt"></td>
- <td class="tblHead"> </td>
- </tr>
- <tr>
- <td class="frmText11"><input type="text" name="search_server_id" value="{tmpl_var name='search_server_id'}" class="text" size="5" /></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="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
- </tr>
- <tmpl_loop name="records">
- <tr bgcolor="{tmpl_var name="bgcolor"}">
- <td class="frmText11"><a href="mail_domain_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
- <td class="frmText11"><a href="mail_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('mail_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="3" height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
- </tr>
-</table>
+<form name="myform" action="mail_domain_list.php" method="POST">
+<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
+<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_domain_edit.php'" /><br /><br />
+<table width="100%" border="0" cellspacing="0" cellpadding="4">
+ <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"> </td>
+ </tr>
+ <tr>
+ <td class="frmText11"><select name="search_active" onChange="document.myform.submit();">{tmpl_var name='search_active'}</select></td>
+ <td class="frmText11"><select name="search_server_id" onChange="document.myform.submit();">{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="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
+ </tr>
+ <tmpl_loop name="records">
+ <tr bgcolor="{tmpl_var name="bgcolor"}">
+ <td class="frmText11"><a href="mail_domain_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="active"}</a></td>
+ <td class="frmText11"><a href="mail_domain_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
+ <td class="frmText11"><a href="mail_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('mail_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>
</form>
\ No newline at end of file
diff --git a/interface/web/sites/templates/mail_domain_relay_edit.htm b/interface/web/mail/templates/mail_domain_relay_edit.htm
similarity index 100%
rename from interface/web/sites/templates/mail_domain_relay_edit.htm
rename to interface/web/mail/templates/mail_domain_relay_edit.htm
diff --git a/interface/web/sites/templates/mail_domain_relay_list.htm b/interface/web/mail/templates/mail_domain_relay_list.htm
similarity index 62%
rename from interface/web/sites/templates/mail_domain_relay_list.htm
rename to interface/web/mail/templates/mail_domain_relay_list.htm
index 7c2c0eb..ae1f2ee 100644
--- a/interface/web/sites/templates/mail_domain_relay_list.htm
+++ b/interface/web/mail/templates/mail_domain_relay_list.htm
@@ -1,27 +1,29 @@
-<form name="myform" action="mail_domain_relay_list.php" method="POST">
-<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
-<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_domain_relay_edit.php'" /><br /><br />
-<table width="100%" border="0" cellspacing="0" cellpadding="4">
- <tr>
- <td class="tblHead"><tmpl_var name="server_id_txt"></td>
- <td class="tblHead"><tmpl_var name="domain_txt"></td>
- <td class="tblHead"> </td>
- </tr>
- <tr>
- <td class="frmText11"><input type="text" name="search_server_id" value="{tmpl_var name='search_server_id'}" class="text" /></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="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
- </tr>
- <tmpl_loop name="records">
- <tr bgcolor="{tmpl_var name="bgcolor"}">
- <td class="frmText11"><a href="mail_domain_relay_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
- <td class="frmText11"><a href="mail_domain_relay_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('mail_domain_relay_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>
+<form name="myform" action="mail_domain_relay_list.php" method="POST">
+<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
+<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_domain_relay_edit.php'" /><br /><br />
+<table width="100%" border="0" cellspacing="0" cellpadding="4">
+ <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"> </td>
+ </tr>
+ <tr>
+ <td class="frmText11"><select name="search_active" onChange="document.myform.submit();">{tmpl_var name='search_active'}</select></td>
+ <td class="frmText11"><select name="search_server_id" onChange="document.myform.submit();">{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="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
+ </tr>
+ <tmpl_loop name="records">
+ <tr bgcolor="{tmpl_var name="bgcolor"}">
+ <td class="frmText11"><a href="mail_forward_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="active"}</a></td>
+ <td class="frmText11"><a href="mail_domain_relay_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
+ <td class="frmText11"><a href="mail_domain_relay_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('mail_domain_relay_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>
</form>
\ No newline at end of file
diff --git a/interface/web/sites/templates/mail_forward_edit.htm b/interface/web/mail/templates/mail_forward_edit.htm
similarity index 100%
rename from interface/web/sites/templates/mail_forward_edit.htm
rename to interface/web/mail/templates/mail_forward_edit.htm
diff --git a/interface/web/sites/templates/mail_forward_list.htm b/interface/web/mail/templates/mail_forward_list.htm
similarity index 100%
rename from interface/web/sites/templates/mail_forward_list.htm
rename to interface/web/mail/templates/mail_forward_list.htm
diff --git a/interface/web/mail/templates/mail_spamfilter_edit.htm b/interface/web/mail/templates/mail_spamfilter_edit.htm
new file mode 100644
index 0000000..044b5e1
--- /dev/null
+++ b/interface/web/mail/templates/mail_spamfilter_edit.htm
@@ -0,0 +1,66 @@
+<table width="500" border="0" cellspacing="0" cellpadding="2">
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='email_txt'}:</td>
+ <td width="366" class="frmText11"><input name="email_local_part" type="text" class="text" value="{tmpl_var name='email_local_part'}" size="10" maxlength="50"> @ <select name="email_domain">{tmpl_var name="email_domain"}</select></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='active_txt'}:</td>
+ <td width="366" class="frmText11">{tmpl_var name='active'}</td>
+ </tr>
+ <tr>
+ <td colspan="2" class="frmText11"> </td>
+ </tr>
+ <tr>
+ <td colspan="2" height="50" class="frmText11"><b>{tmpl_var name='spam_rewrite_txt'}</b></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='spam_rewrite_score_int_txt'}:</td>
+ <td width="366" class="frmText11"><input name="spam_rewrite_score_int" type="text" class="text" value="{tmpl_var name='spam_rewrite_score_int'}" size="10" maxlength="10"></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='spam_rewrite_subject_txt'}:</td>
+ <td width="366" class="frmText11"><input name="spam_rewrite_subject" type="text" class="text" value="{tmpl_var name='spam_rewrite_subject'}" size="30" maxlength="255"></td>
+ </tr>
+ <tr>
+ <td colspan="2" class="frmText11"> </td>
+ </tr>
+ <tr>
+ <td colspan="2" height="50" class="frmText11"><b>{tmpl_var name='spam_redirect_txt'}</b></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='spam_redirect_score_int_txt'}:</td>
+ <td width="366" class="frmText11"><input name="spam_redirect_score_int" type="text" class="text" value="{tmpl_var name='spam_redirect_score_int'}" size="10" maxlength="10"></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='spam_redirect_maildir_txt'}:</td>
+ <td width="366" class="frmText11">
+ <select name="spam_redirect_maildir" class="text">
+ {tmpl_var name='spam_redirect_maildir'}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='spam_redirect_maildir_purge_txt'}:</td>
+ <td width="366" class="frmText11"><input name="spam_redirect_maildir_purge" type="text" class="text" value="{tmpl_var name='spam_redirect_maildir_purge'}" size="5" maxlength="10"> {tmpl_var name='days_txt'}</td>
+ </tr>
+ <tr>
+ <td colspan="2" class="frmText11"> </td>
+ </tr>
+ <tr>
+ <td colspan="2" height="50" class="frmText11"><b>{tmpl_var name='spam_delete_txt'}</b></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='spam_delete_score_int_txt'}:</td>
+ <td width="366" class="frmText11"><input name="spam_delete_score_int" type="text" class="text" value="{tmpl_var name='spam_delete_score_int'}" size="10" maxlength="10"></td>
+ </tr>
+ <tr>
+ <td colspan="2" height="50" class="frmText11">{tmpl_var name='disable_txt'}</td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td><input name="btn_save" type="submit" class="button" value="{tmpl_var name='btn_save_txt'}">
+ <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="self.location.href='mail_spamfilter_list.php';">
+ </td>
+ </tr>
+</table>
+<input type="hidden" name="id" value="{tmpl_var name='id'}">
\ No newline at end of file
diff --git a/interface/web/mail/templates/mail_spamfilter_list.htm b/interface/web/mail/templates/mail_spamfilter_list.htm
new file mode 100644
index 0000000..d1507bd
--- /dev/null
+++ b/interface/web/mail/templates/mail_spamfilter_list.htm
@@ -0,0 +1,30 @@
+<form name="myform" action="mail_spamfilter_list.php" method="POST">
+<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
+<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_spamfilter_edit.php'" /><br /><br />
+<table width="100%" border="0" cellspacing="0" cellpadding="4">
+ <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="email_txt"></td>
+ <td class="tblHead"> </td>
+ </tr>
+ <tr>
+ <td class="frmText11"><select name="search_active" onChange="document.myform.submit();">{tmpl_var name='search_active'}</select></td>
+ <td class="frmText11"><select name="search_server_id" onChange="document.myform.submit();">{tmpl_var name='search_server_id'}</select></td>
+ <td class="frmText11"><input type="text" name="search_email" value="{tmpl_var name='search_email'}" class="text" /></td>
+ <td class="frmText11" align="right"><input name="Filter" type="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
+ </tr>
+ <tmpl_loop name="records">
+ <tr bgcolor="{tmpl_var name="bgcolor"}">
+ <td class="frmText11"><a href="mail_spamfilter_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="active"}</a></td>
+ <td class="frmText11"><a href="mail_spamfilter_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
+ <td class="frmText11"><a href="mail_spamfilter_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="email"}</a></td>
+ <td class="frmText11" align="right">[<a href="javascript: del_record('mail_spamfilter_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>
+</form>
\ No newline at end of file
diff --git a/interface/web/sites/templates/mail_whitelist_edit.htm b/interface/web/mail/templates/mail_whitelist_edit.htm
similarity index 76%
rename from interface/web/sites/templates/mail_whitelist_edit.htm
rename to interface/web/mail/templates/mail_whitelist_edit.htm
index 8c11d09..96b2e95 100644
--- a/interface/web/sites/templates/mail_whitelist_edit.htm
+++ b/interface/web/mail/templates/mail_whitelist_edit.htm
@@ -1,28 +1,32 @@
-<table width="500" border="0" cellspacing="0" cellpadding="2">
- <tr>
- <td width="126" class="frmText11">{tmpl_var name='server_id_txt'}:</td>
- <td width="366" class="frmText11">
- <select name="server_id" class="text">
- {tmpl_var name='server_id'}
- </select>
- </td>
- </tr>
- <tr>
- <td width="126" class="frmText11">{tmpl_var name='address_txt'}:</td>
- <td width="366" class="frmText11"><input name="address" type="text" class="text" value="{tmpl_var name='address'}" size="30" maxlength="255"></td>
- </tr>
- <tr>
- <td width="126" class="frmText11">{tmpl_var name='active_txt'}:</td>
- <td width="366" class="frmText11">{tmpl_var name='active'}</td>
- </tr> <tr>
- <td class="frmText11"> </td>
- <td class="frmText11"> </td>
- </tr>
- <tr>
- <td> </td>
- <td><input name="btn_save" type="submit" class="button" value="{tmpl_var name='btn_save_txt'}">
- <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="self.location.href='mail_whitelist_list.php';">
- </td>
- </tr>
-</table>
+<table width="500" border="0" cellspacing="0" cellpadding="2">
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='server_id_txt'}:</td>
+ <td width="366" class="frmText11">
+ <select name="server_id" class="text">
+ {tmpl_var name='server_id'}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='address_txt'}:</td>
+ <td width="366" class="frmText11"><input name="address" type="text" class="text" value="{tmpl_var name='address'}" size="30" maxlength="255"></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='recipient_txt'}:</td>
+ <td width="366" class="frmText11"><input name="recipient_local_part" type="text" class="text" value="{tmpl_var name='recipient_local_part'}" size="10" maxlength="50"> @ <select name="recipient_domain">{tmpl_var name="recipient_domain"}</select></td>
+ </tr>
+ <tr>
+ <td width="126" class="frmText11">{tmpl_var name='active_txt'}:</td>
+ <td width="366" class="frmText11">{tmpl_var name='active'}</td>
+ </tr> <tr>
+ <td class="frmText11"> </td>
+ <td class="frmText11"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td><input name="btn_save" type="submit" class="button" value="{tmpl_var name='btn_save_txt'}">
+ <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="self.location.href='mail_whitelist_list.php';">
+ </td>
+ </tr>
+</table>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
\ No newline at end of file
diff --git a/interface/web/mail/templates/mail_whitelist_list.htm b/interface/web/mail/templates/mail_whitelist_list.htm
new file mode 100644
index 0000000..6c46d1f
--- /dev/null
+++ b/interface/web/mail/templates/mail_whitelist_list.htm
@@ -0,0 +1,32 @@
+<form name="myform" action="mail_whitelist_list.php" method="POST">
+<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
+<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_whitelist_edit.php'" /><br /><br />
+<table width="100%" border="0" cellspacing="0" cellpadding="4">
+ <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="address_txt"></td>
+ <td class="tblHead"><tmpl_var name="recipient_txt"></td>
+ <td class="tblHead"> </td>
+ </tr>
+ <tr>
+ <td class="frmText11"><select name="search_active" onChange="document.myform.submit();">{tmpl_var name='search_active'}</select></td>
+ <td class="frmText11"><select name="search_server_id" onChange="document.myform.submit();">{tmpl_var name='search_server_id'}</select></td>
+ <td class="frmText11"><input type="text" name="search_address" value="{tmpl_var name='search_address'}" class="text" /></td>
+ <td class="frmText11"><input type="text" name="search_recipient" value="{tmpl_var name='search_recipient'}" class="text" /></td>
+ <td class="frmText11" align="right"><input name="Filter" type="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
+ </tr>
+ <tmpl_loop name="records">
+ <tr bgcolor="{tmpl_var name="bgcolor"}">
+ <td class="frmText11"><a href="mail_whitelist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="active"}</a></td>
+ <td class="frmText11"><a href="mail_whitelist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
+ <td class="frmText11"><a href="mail_whitelist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="address"}</a></td>
+ <td class="frmText11"><a href="mail_whitelist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="recipient"}</a></td>
+ <td class="frmText11" align="right">[<a href="javascript: del_record('mail_whitelist_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>
+</form>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_domain_alias.lng b/interface/web/sites/lib/lang/en_mail_domain_alias.lng
deleted file mode 100644
index 37d6fb0..0000000
--- a/interface/web/sites/lib/lang/en_mail_domain_alias.lng
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-$wb["server_id_txt"] = 'Server';
-$wb["domain_txt"] = 'Domain';
-$wb["destination_txt"] = 'Destination';
-$wb["active_txt"] = 'Active';
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["domain_error_empty"] = 'Domain is empty.';
-$wb["domain_error_unique"] = 'Duplicate Domain.';
-$wb["destination_error_empty"] = 'Destination is empty.';
-?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/lang/en_mail_whitelist.lng b/interface/web/sites/lib/lang/en_mail_whitelist.lng
deleted file mode 100644
index a2f71fe..0000000
--- a/interface/web/sites/lib/lang/en_mail_whitelist.lng
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-$wb["server_id_txt"] = 'Server';
-$wb["address_txt"] = 'Address';
-$wb["active_txt"] = 'Active';
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["address_error_notempty"] = 'Address is empty.';
-?>
\ No newline at end of file
diff --git a/interface/web/sites/lib/module.conf.php b/interface/web/sites/lib/module.conf.php
deleted file mode 100644
index dcdf738..0000000
--- a/interface/web/sites/lib/module.conf.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-$module = array (
- 'name' => 'sites',
- 'title' => 'Sites & Email',
- 'template' => 'module.tpl.htm',
- 'navframe_page' => '',
- 'startpage' => 'sites/index.php',
- 'tab_width' => '',
- 'nav' =>
- array (
- 0 =>
- array (
- 'title' => 'Email Accounts',
- 'open' => 1,
- 'items' =>
- array (
- 0 =>
- array (
- 'title' => 'Domain',
- 'target' => 'content',
- 'link' => 'sites/mail_domain_list.php',
- ),
- 1 =>
- array (
- 'title' => 'Domain Alias',
- 'target' => 'content',
- 'link' => 'sites/mail_domain_alias_list.php',
- ),
- 2 =>
- array (
- 'title' => 'Domain Relay',
- 'target' => 'content',
- 'link' => 'sites/mail_domain_relay_list.php',
- ),
- 3 =>
- array (
- 'title' => 'Email Mailbox',
- 'target' => 'content',
- 'link' => 'sites/mail_box_list.php',
- ),
- 4 =>
- array (
- 'title' => 'Email Alias',
- 'target' => 'content',
- 'link' => 'sites/mail_alias_list.php',
- ),
- 5 =>
- array (
- 'title' => 'Email Forward',
- 'target' => 'content',
- 'link' => 'sites/mail_forward_list.php',
- ),
- 6 =>
- array (
- 'title' => 'Email Catchall',
- 'target' => 'content',
- 'link' => 'sites/mail_domain_catchall_list.php',
- ),
- 7 =>
- array (
- 'title' => 'Email Routing',
- 'target' => 'content',
- 'link' => '',
- ),
- ),
- ),
- 1 =>
- array (
- 'title' => 'Email Filter',
- 'open' => 1,
- 'items' =>
- array (
- 0 =>
- array (
- 'title' => 'Email Whitelist',
- 'target' => 'content',
- 'link' => 'sites/mail_whitelist_list.php',
- ),
- 1 =>
- array (
- 'title' => 'Email Blacklist',
- 'target' => 'content',
- 'link' => 'sites/mail_blacklist_list.php',
- ),
- ),
- ),
- ),
-)
-?>
\ No newline at end of file
diff --git a/interface/web/sites/mail_whitelist_edit.php b/interface/web/sites/mail_whitelist_edit.php
deleted file mode 100644
index 9eec206..0000000
--- a/interface/web/sites/mail_whitelist_edit.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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.
-*/
-
-
-/******************************************
-* Begin Form configuration
-******************************************/
-
-$tform_def_file = "form/mail_whitelist.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"],$_SESSION["s"]["module"]["name"])) {
- header("Location: ../index.php");
- exit;
-}
-
-// Loading classes
-$app->uses('tpl,tform,tform_actions');
-$app->tform_actions->onLoad();
-
-
-?>
\ No newline at end of file
diff --git a/interface/web/sites/templates/mail_blacklist_list.htm b/interface/web/sites/templates/mail_blacklist_list.htm
deleted file mode 100644
index 34cb69c..0000000
--- a/interface/web/sites/templates/mail_blacklist_list.htm
+++ /dev/null
@@ -1,27 +0,0 @@
-<form name="myform" action="mail_blacklist_list.php" method="POST">
-<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
-<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_blacklist_edit.php'" /><br /><br />
-<table width="100%" border="0" cellspacing="0" cellpadding="4">
- <tr>
- <td class="tblHead"><tmpl_var name="server_id_txt"></td>
- <td class="tblHead"><tmpl_var name="address_txt"></td>
- <td class="tblHead"> </td>
- </tr>
- <tr>
- <td class="frmText11"><input type="text" name="search_server_id" value="{tmpl_var name='search_server_id'}" class="text" /></td>
- <td class="frmText11"><input type="text" name="search_address" value="{tmpl_var name='search_address'}" class="text" /></td>
- <td class="frmText11" align="right"><input name="Filter" type="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
- </tr>
- <tmpl_loop name="records">
- <tr bgcolor="{tmpl_var name="bgcolor"}">
- <td class="frmText11"><a href="mail_blacklist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
- <td class="frmText11"><a href="mail_blacklist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="address"}</a></td>
- <td class="frmText11" align="right">[<a href="javascript: del_record('mail_blacklist_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>
-</form>
\ No newline at end of file
diff --git a/interface/web/sites/templates/mail_whitelist_list.htm b/interface/web/sites/templates/mail_whitelist_list.htm
deleted file mode 100644
index 0046185..0000000
--- a/interface/web/sites/templates/mail_whitelist_list.htm
+++ /dev/null
@@ -1,27 +0,0 @@
-<form name="myform" action="mail_whitelist_list.php" method="POST">
-<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
-<input type="button" value="{tmpl_var name="add_new_record_txt"}" onClick="location.href='mail_whitelist_edit.php'" /><br /><br />
-<table width="100%" border="0" cellspacing="0" cellpadding="4">
- <tr>
- <td class="tblHead"><tmpl_var name="server_id_txt"></td>
- <td class="tblHead"><tmpl_var name="address_txt"></td>
- <td class="tblHead"> </td>
- </tr>
- <tr>
- <td class="frmText11"><input type="text" name="search_server_id" value="{tmpl_var name='search_server_id'}" class="text" /></td>
- <td class="frmText11"><input type="text" name="search_address" value="{tmpl_var name='search_address'}" class="text" /></td>
- <td class="frmText11" align="right"><input name="Filter" type="submit" id="Filter" value="{tmpl_var name="filter_txt"}"></td>
- </tr>
- <tmpl_loop name="records">
- <tr bgcolor="{tmpl_var name="bgcolor"}">
- <td class="frmText11"><a href="mail_whitelist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="server_id"}</a></td>
- <td class="frmText11"><a href="mail_whitelist_edit.php?id={tmpl_var name='id'}" class="frmText11">{tmpl_var name="address"}</a></td>
- <td class="frmText11" align="right">[<a href="javascript: del_record('mail_whitelist_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>
-</form>
\ No newline at end of file
--
Gitblit v1.9.1