Skip to content

Commit 8fab6e9

Browse files
committed
Added Domain relay and exim4 config
1 parent dd0fc92 commit 8fab6e9

25 files changed

+1021
-16
lines changed

config/exim4/exim4.conf.template

Lines changed: 434 additions & 0 deletions
Large diffs are not rendered by default.

interface/lib/classes/listform_actions.inc.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,15 @@ function getQueryString() {
9999
// Generate the search sql
100100
if($app->listform->listDef["auth"] != 'no') {
101101
if($_SESSION["s"]["user"]["typ"] == "admin") {
102-
$sql_where = $this->SQLExtWhere;
102+
$sql_where = "";
103103
} else {
104-
$sql_where = $this->SQLExtWhere ." ". $app->tform->getAuthSQL('r')." and";
104+
$sql_where = $app->tform->getAuthSQL('r')." and";
105105
}
106106
}
107+
108+
if($this->SQLExtWhere != '') {
109+
$sql_where .= " ".$this->SQLExtWhere." and";
110+
}
107111

108112
$sql_where = $app->listform->getSearchSQL($sql_where);
109113
$app->tpl->setVar($app->listform->searchValues);

interface/lib/classes/tform.inc.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class tform {
107107
var $formDef;
108108
var $wordbook;
109109
var $module;
110+
var $primary_id;
110111

111112
/**
112113
* Laden der Tabellendefinition
@@ -535,14 +536,15 @@ function validateField($field_name, $field_value, $validators) {
535536
}
536537
break;
537538
case 'UNIQUE':
538-
$num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."'");
539539
if($this->action == 'NEW') {
540+
$num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."'");
540541
if($num_rec["number"] > 0) {
541542
$errmsg = $validator['errmsg'];
542543
$this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
543544
}
544545
} else {
545-
if($num_rec["number"] > 1) {
546+
$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);
547+
if($num_rec["number"] > 0) {
546548
$errmsg = $validator['errmsg'];
547549
$this->errorMessage .= $this->wordbook[$errmsg]."<br>\r\n";
548550
}
@@ -610,6 +612,7 @@ function getSQL($record, $tab, $action = 'INSERT', $primary_id = 0, $sql_ext_whe
610612
}
611613

612614
$this->action = $action;
615+
$this->primary_id = $primary_id;
613616

614617
$record = $this->encode($record,$tab);
615618
$sql_insert_key = '';
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?php
2+
3+
/*
4+
Form Definition
5+
6+
Tabledefinition
7+
8+
Datatypes:
9+
- INTEGER (Forces the input to Int)
10+
- DOUBLE
11+
- CURRENCY (Formats the values to currency notation)
12+
- VARCHAR (no format check, maxlength: 255)
13+
- TEXT (no format check)
14+
- DATE (Dateformat, automatic conversion to timestamps)
15+
16+
Formtype:
17+
- TEXT (Textfield)
18+
- TEXTAREA (Textarea)
19+
- PASSWORD (Password textfield, input is not shown when edited)
20+
- SELECT (Select option field)
21+
- RADIO
22+
- CHECKBOX
23+
- CHECKBOXARRAY
24+
- FILE
25+
26+
VALUE:
27+
- Wert oder Array
28+
29+
Hint:
30+
The ID field of the database table is not part of the datafield definition.
31+
The ID field must be always auto incement (int or bigint).
32+
33+
34+
*/
35+
36+
$form["title"] = "Mail Domain";
37+
$form["description"] = "";
38+
$form["name"] = "mail_domain";
39+
$form["action"] = "mail_domain_edit.php";
40+
$form["db_table"] = "mail_domain";
41+
$form["db_table_idx"] = "domain_id";
42+
$form["db_history"] = "yes";
43+
$form["tab_default"] = "domain";
44+
$form["list_default"] = "mail_domain_list.php";
45+
$form["auth"] = 'yes'; // yes / no
46+
47+
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
48+
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
49+
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
50+
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
51+
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
52+
53+
$form["tabs"]['domain'] = array (
54+
'title' => "Domain",
55+
'width' => 100,
56+
'template' => "templates/mail_domain_edit.htm",
57+
'fields' => array (
58+
##################################
59+
# Begin Datatable fields
60+
##################################
61+
'server_id' => array (
62+
'datatype' => 'INTEGER',
63+
'formtype' => 'SELECT',
64+
'default' => '',
65+
'datasource' => array ( 'type' => 'SQL',
66+
'querystring' => 'SELECT server_id,server_name FROM server WHERE 1 ORDER BY server_name',
67+
'keyfield'=> 'server_id',
68+
'valuefield'=> 'server_name'
69+
),
70+
'value' => ''
71+
),
72+
'domain' => array (
73+
'datatype' => 'VARCHAR',
74+
'formtype' => 'TEXT',
75+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
76+
'errmsg'=> 'domain_error_empty'),
77+
1 => array ( 'type' => 'UNIQUE',
78+
'errmsg'=> 'domain_error_unique'),
79+
),
80+
'default' => '',
81+
'value' => '',
82+
'width' => '30',
83+
'maxlength' => '255'
84+
),
85+
'type' => array (
86+
'datatype' => 'VARCHAR',
87+
'formtype' => 'SELECT',
88+
'default' => '',
89+
'value' => array('local' => 'local','relay'=>'relay','manual_relay'=>'manual Relay')
90+
),
91+
'active' => array (
92+
'datatype' => 'INTEGER',
93+
'formtype' => 'CHECKBOX',
94+
'default' => '1',
95+
'value' => '1'
96+
),
97+
##################################
98+
# ENDE Datatable fields
99+
##################################
100+
)
101+
);
102+
103+
104+
?>

interface/web/sites/form/mail_domain.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
$form["db_history"] = "yes";
4343
$form["tab_default"] = "domain";
4444
$form["list_default"] = "mail_domain_list.php";
45-
$form["auth"] = 'no';
45+
$form["auth"] = 'yes'; // yes / no
4646

4747
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
4848
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user

interface/web/sites/form/mail_domain_alias.tform.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
$form["db_history"] = "yes";
4343
$form["tab_default"] = "domain";
4444
$form["list_default"] = "mail_domain_alias_list.php";
45-
$form["auth"] = 'no';
45+
$form["auth"] = 'yes'; // yes / no
4646

4747
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
4848
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
@@ -87,8 +87,6 @@
8787
'formtype' => 'TEXT',
8888
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
8989
'errmsg'=> 'destination_error_empty'),
90-
1 => array ( 'type' => 'UNIQUE',
91-
'errmsg'=> 'destination_error_unique'),
9290
),
9391
'default' => '',
9492
'value' => '',
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?php
2+
3+
/*
4+
Form Definition
5+
6+
Tabledefinition
7+
8+
Datatypes:
9+
- INTEGER (Forces the input to Int)
10+
- DOUBLE
11+
- CURRENCY (Formats the values to currency notation)
12+
- VARCHAR (no format check, maxlength: 255)
13+
- TEXT (no format check)
14+
- DATE (Dateformat, automatic conversion to timestamps)
15+
16+
Formtype:
17+
- TEXT (Textfield)
18+
- TEXTAREA (Textarea)
19+
- PASSWORD (Password textfield, input is not shown when edited)
20+
- SELECT (Select option field)
21+
- RADIO
22+
- CHECKBOX
23+
- CHECKBOXARRAY
24+
- FILE
25+
26+
VALUE:
27+
- Wert oder Array
28+
29+
Hint:
30+
The ID field of the database table is not part of the datafield definition.
31+
The ID field must be always auto incement (int or bigint).
32+
33+
34+
*/
35+
36+
$form["title"] = "Domain Relay";
37+
$form["description"] = "";
38+
$form["name"] = "mail_domain_relay";
39+
$form["action"] = "mail_domain_relay_edit.php";
40+
$form["db_table"] = "mail_domain";
41+
$form["db_table_idx"] = "domain_id";
42+
$form["db_history"] = "yes";
43+
$form["tab_default"] = "domain";
44+
$form["list_default"] = "mail_domain_relay_list.php";
45+
$form["auth"] = 'yes'; // yes / no
46+
47+
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
48+
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
49+
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
50+
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
51+
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
52+
53+
$form["tabs"]['domain'] = array (
54+
'title' => "Domain",
55+
'width' => 100,
56+
'template' => "templates/mail_domain_relay_edit.htm",
57+
'fields' => array (
58+
##################################
59+
# Begin Datatable fields
60+
##################################
61+
'server_id' => array (
62+
'datatype' => 'INTEGER',
63+
'formtype' => 'SELECT',
64+
'default' => '',
65+
'datasource' => array ( 'type' => 'SQL',
66+
'querystring' => 'SELECT server_id,server_name FROM server WHERE 1 ORDER BY server_name',
67+
'keyfield'=> 'server_id',
68+
'valuefield'=> 'server_name'
69+
),
70+
'value' => ''
71+
),
72+
'domain' => array (
73+
'datatype' => 'VARCHAR',
74+
'formtype' => 'TEXT',
75+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
76+
'errmsg'=> 'domain_error_empty'),
77+
1 => array ( 'type' => 'UNIQUE',
78+
'errmsg'=> 'domain_error_unique'),
79+
),
80+
'default' => '',
81+
'value' => '',
82+
'width' => '30',
83+
'maxlength' => '255'
84+
),
85+
'type' => array (
86+
'datatype' => 'VARCHAR',
87+
'formtype' => 'SELECT',
88+
'default' => '',
89+
'value' => array('relay'=>'relay','local' => 'local','manual_relay'=>'manual Relay')
90+
),
91+
'active' => array (
92+
'datatype' => 'INTEGER',
93+
'formtype' => 'CHECKBOX',
94+
'default' => '1',
95+
'value' => '1'
96+
),
97+
##################################
98+
# ENDE Datatable fields
99+
##################################
100+
)
101+
);
102+
103+
104+
?>

interface/web/sites/lib/lang/en_mail_domain.lng

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ $wb["type_txt"] = 'Type';
55
$wb["active_txt"] = 'Active';
66
$wb["btn_save_txt"] = 'Save';
77
$wb["btn_cancel_txt"] = 'Cancel';
8+
$wb["domain_error_empty"] = 'Domain is empty.';
9+
$wb["domain_error_unique"] = 'Duplicate Domain.';
10+
$wb["destination_error_empty"] = 'Destination is empty.';
11+
812
?>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
$wb["server_id_txt"] = 'Server';
3+
$wb["domain_txt"] = 'Domain';
4+
$wb["destination_txt"] = 'Destination';
5+
$wb["active_txt"] = 'Active';
6+
$wb["btn_save_txt"] = 'Save';
7+
$wb["btn_cancel_txt"] = 'Cancel';
8+
$wb["domain_error_empty"] = 'Domain is empty.';
9+
$wb["domain_error_unique"] = 'Duplicate Domain.';
10+
$wb["destination_error_empty"] = 'Destination is empty.';
11+
?>
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
2-
$wb["list_head_txt"] = 'mail_domain_alias';
3-
$wb["server_id_txt"] = 'server_id';
4-
$wb["domain_txt"] = 'domain';
5-
$wb["destination_txt"] = 'destination';
2+
$wb["list_head_txt"] = 'Domain Alias';
3+
$wb["server_id_txt"] = 'Server';
4+
$wb["domain_txt"] = 'Domain';
5+
$wb["destination_txt"] = 'Destination';
66
$wb["page_txt"] = 'Page';
77
$wb["page_of_txt"] = 'of';
88
$wb["page_next_txt"] = 'Next';
99
$wb["page_back_txt"] = 'Back';
1010
$wb["delete_txt"] = 'Delete';
1111
$wb["filter_txt"] = 'Filter';
12+
$wb["add_new_record_txt"] = 'Add new Alias Domain';
1213
?>

0 commit comments

Comments
 (0)