Skip to content

Commit 83b0d0f

Browse files
committed
Added mail domains
1 parent 336a577 commit 83b0d0f

21 files changed

+769
-5
lines changed

interface/lib/classes/listform_actions.inc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ function onLoad() {
5050
// Load list definition
5151
$app->listform->loadListDef($list_def_file);
5252

53+
if(!is_file('templates/'.$app->listform->listDef["name"].'_list.htm')) {
54+
$app->uses('listform_tpl_generator');
55+
$app->listform_tpl_generator->buildHTML($app->listform->listDef);
56+
}
57+
5358
$app->tpl->newTemplate("form.tpl.htm");
5459
$app->tpl->setInclude('content_tpl','templates/'.$app->listform->listDef["name"].'_list.htm');
5560

interface/lib/classes/tform.inc.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ function getDatasourceData($field, $record) {
218218

219219
// Getting the records
220220
$tmp_records = $app->db->queryAllRecords($querystring);
221+
if($app->db->errorMessage != '') die($app->db->errorMessage);
221222
if(is_array($tmp_records)) {
222223
$key_field = $field["datasource"]["keyfield"];
223224
$value_field = $field["datasource"]["valuefield"];
@@ -240,6 +241,8 @@ function getDatasourceData($field, $record) {
240241
}
241242
}
242243

244+
return $values;
245+
243246
}
244247

245248

@@ -354,6 +357,12 @@ function getHTML($record, $tab, $action = 'NEW') {
354357
} else {
355358
// Action: NEW
356359
foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
360+
361+
// If Datasource is set, get the data from there
362+
if(is_array($field['datasource'])) {
363+
$field["value"] = $this->getDatasourceData($field, $record);
364+
}
365+
357366
switch ($field['formtype']) {
358367
case 'SELECT':
359368
if(is_array($field['value'])) {

interface/lib/classes/tform_actions.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function onUpdate() {
105105
$sql = $app->tform->getSQL($this->dataRecord,$app->tform->getCurrentTab(),'UPDATE',$this->id,$ext_where);
106106
if($app->tform->errorMessage == '') {
107107
$app->db->query($sql);
108+
if($app->db->errorMessage != '') die($app->db->errorMessage);
108109

109110
// Call plugin
110111
foreach($this->plugins as $plugin) {
@@ -133,6 +134,7 @@ function onInsert() {
133134
$sql = $app->tform->getSQL($this->dataRecord,$app->tform->getCurrentTab(),'INSERT',$this->id,$ext_where);
134135
if($app->tform->errorMessage == '') {
135136
$app->db->query($sql);
137+
if($app->db->errorMessage != '') die($app->db->errorMessage);
136138
$this->id = $app->db->insertID();
137139

138140
// Call plugin

interface/sql/auth_sql_snippet.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ALTER TABLE `mail_domain` ADD `sys_userid` INT NOT NULL AFTER `domain_id` ,
2+
ADD `sys_groupid` INT NOT NULL AFTER `sys_userid` ,
3+
ADD `sys_perm_user` VARCHAR( 5 ) NOT NULL AFTER `sys_groupid` ,
4+
ADD `sys_perm_group` VARCHAR( 5 ) NOT NULL AFTER `sys_perm_user` ,
5+
ADD `sys_perm_other` VARCHAR( 5 ) NOT NULL AFTER `sys_perm_group` ;

interface/sql/ispconfig3db.sql

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# http://www.phpmyadmin.net/ (download page)
44
#
55
# Host: localhost
6-
# Erstellungszeit: 01. November 2005 um 23:57
6+
# Erstellungszeit: 09. November 2005 um 23:22
77
# Server Version: 4.0.23
88
# PHP-Version: 5.0.3
99
# Datenbank: `ispconfig3`
@@ -35,10 +35,17 @@ CREATE TABLE mail_blacklist (
3535
DROP TABLE IF EXISTS mail_domain;
3636
CREATE TABLE mail_domain (
3737
domain_id int(11) NOT NULL auto_increment,
38+
sys_userid int(11) NOT NULL default '0',
39+
sys_groupid int(11) NOT NULL default '0',
40+
sys_perm_user varchar(5) NOT NULL default '',
41+
sys_perm_group varchar(5) NOT NULL default '',
42+
sys_perm_other varchar(5) NOT NULL default '',
3843
server_id int(11) NOT NULL default '0',
3944
domain varchar(255) NOT NULL default '',
40-
type enum('local','relay','manual_relay') NOT NULL default 'local',
45+
type enum('local','relay','manual_relay','alias') NOT NULL default 'local',
4146
relay_host varchar(255) NOT NULL default '',
47+
destination varchar(255) NOT NULL default '',
48+
active tinyint(4) NOT NULL default '1',
4249
PRIMARY KEY (domain_id),
4350
KEY server_id (server_id,domain,type)
4451
) TYPE=MyISAM;
@@ -47,6 +54,7 @@ CREATE TABLE mail_domain (
4754
# Daten für Tabelle `mail_domain`
4855
#
4956

57+
INSERT INTO mail_domain VALUES (1, 1, 0, 'riud', 'riud', '', 1, 'test.de', 'local', '', '', 1);
5058
# --------------------------------------------------------
5159

5260
#
@@ -399,5 +407,5 @@ CREATE TABLE sys_user (
399407
# Daten für Tabelle `sys_user`
400408
#
401409

402-
INSERT INTO sys_user VALUES (1, 1, 0, 'riud', 'riud', '', 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin,clients,designer,resellers,sites', 'admin', 'default', 'admin', 1, '', 'Administrator', '', '', '', '', '', '', '', '', '', 'en', '1,2', 0);
410+
INSERT INTO sys_user VALUES (1, 1, 0, 'riud', 'riud', '', 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin,designer,sites', 'admin', 'default', 'admin', 1, '', 'Administrator', '', '', '', '', '', '', '', '', '', 'en', '1,2', 0);
403411

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
$wb["list_head_txt"] = 'Server';
3+
$wb["server_name_txt"] = 'Name';
4+
$wb["mail_server_txt"] = 'Mail';
5+
$wb["web_server_txt"] = 'Web';
6+
$wb["dns_server_txt"] = 'DNS';
7+
$wb["file_server_txt"] = 'File';
8+
$wb["mysql_server_txt"] = 'MySQL';
9+
$wb["postgresql_server_txt"] = 'PostgreSQL';
10+
$wb["firebird_server_txt"] = 'Firebird';
11+
$wb["page_txt"] = 'Page';
12+
$wb["page_of_txt"] = 'of';
13+
$wb["page_next_txt"] = 'Next';
14+
$wb["page_back_txt"] = 'Back';
15+
$wb["delete_txt"] = 'Delete';
16+
$wb["filter_txt"] = 'Filter';
17+
?>

interface/web/admin/lib/module.conf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
'link' => 'admin/users_list.php');
1717

1818

19-
$module["nav"][] = array( 'title' => 'Users',
19+
$module["nav"][] = array( 'title' => 'CP Users',
2020
'open' => 1,
2121
'items' => $items);
2222

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?php
2+
3+
/*
4+
Datatypes:
5+
- INTEGER
6+
- DOUBLE
7+
- CURRENCY
8+
- VARCHAR
9+
- TEXT
10+
- DATE
11+
*/
12+
13+
14+
15+
// Name of the list
16+
$liste["name"] = "server";
17+
18+
// Database table
19+
$liste["table"] = "server";
20+
21+
// Index index field of the database table
22+
$liste["table_idx"] = "server_id";
23+
24+
// Search Field Prefix
25+
$liste["search_prefix"] = "search_";
26+
27+
// Records per page
28+
$liste["records_per_page"] = 15;
29+
30+
// Script File of the list
31+
$liste["file"] = "server_list.php";
32+
33+
// Script file of the edit form
34+
$liste["edit_file"] = "server_edit.php";
35+
36+
// Script File of the delete script
37+
$liste["delete_file"] = "server_del.php";
38+
39+
// Paging Template
40+
$liste["paging_tpl"] = "templates/paging.tpl.htm";
41+
42+
// Enable authe
43+
$liste["auth"] = "yes";
44+
45+
46+
/*****************************************************
47+
* Suchfelder
48+
*****************************************************/
49+
50+
$liste["item"][] = array( 'field' => "server_name",
51+
'datatype' => "VARCHAR",
52+
'formtype' => "TEXT",
53+
'op' => "like",
54+
'prefix' => "%",
55+
'suffix' => "%",
56+
'width' => "",
57+
'value' => "");
58+
59+
$liste["item"][] = array( 'field' => "mail_server",
60+
'datatype' => "VARCHAR",
61+
'formtype' => "TEXT",
62+
'op' => "like",
63+
'prefix' => "%",
64+
'suffix' => "%",
65+
'width' => "",
66+
'value' => "");
67+
68+
$liste["item"][] = array( 'field' => "web_server",
69+
'datatype' => "VARCHAR",
70+
'formtype' => "TEXT",
71+
'op' => "like",
72+
'prefix' => "%",
73+
'suffix' => "%",
74+
'width' => "",
75+
'value' => "");
76+
77+
$liste["item"][] = array( 'field' => "dns_server",
78+
'datatype' => "VARCHAR",
79+
'formtype' => "TEXT",
80+
'op' => "like",
81+
'prefix' => "%",
82+
'suffix' => "%",
83+
'width' => "",
84+
'value' => "");
85+
86+
$liste["item"][] = array( 'field' => "file_server",
87+
'datatype' => "VARCHAR",
88+
'formtype' => "TEXT",
89+
'op' => "like",
90+
'prefix' => "%",
91+
'suffix' => "%",
92+
'width' => "",
93+
'value' => "");
94+
95+
$liste["item"][] = array( 'field' => "mysql_server",
96+
'datatype' => "VARCHAR",
97+
'formtype' => "TEXT",
98+
'op' => "like",
99+
'prefix' => "%",
100+
'suffix' => "%",
101+
'width' => "",
102+
'value' => "");
103+
104+
105+
$liste["item"][] = array( 'field' => "postgresql_server",
106+
'datatype' => "VARCHAR",
107+
'formtype' => "TEXT",
108+
'op' => "like",
109+
'prefix' => "%",
110+
'suffix' => "%",
111+
'width' => "",
112+
'value' => "");
113+
114+
115+
$liste["item"][] = array( 'field' => "firebird_server",
116+
'datatype' => "VARCHAR",
117+
'formtype' => "TEXT",
118+
'op' => "like",
119+
'prefix' => "%",
120+
'suffix' => "%",
121+
'width' => "",
122+
'value' => "");
123+
?>

interface/web/admin/server_del.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2005, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
/******************************************
32+
* Begin Form configuration
33+
******************************************/
34+
35+
$list_def_file = "list/server.list.php";
36+
$tform_def_file = "form/server.tform.php";
37+
38+
/******************************************
39+
* End Form configuration
40+
******************************************/
41+
42+
require_once('../../lib/config.inc.php');
43+
require_once('../../lib/app.inc.php');
44+
45+
// Checke Berechtigungen für Modul
46+
if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
47+
header("Location: ../index.php");
48+
exit;
49+
}
50+
51+
$app->uses("tform_actions");
52+
$app->tform_actions->onDelete();
53+
54+
?>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2005, Till Brehm, projektfarm Gmbh
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
require_once('../../lib/config.inc.php');
32+
require_once('../../lib/app.inc.php');
33+
34+
/******************************************
35+
* Begin Form configuration
36+
******************************************/
37+
38+
$list_def_file = "list/server.list.php";
39+
40+
/******************************************
41+
* End Form configuration
42+
******************************************/
43+
44+
// Checking module permissions
45+
if(!stristr($_SESSION["s"]["user"]["modules"],$_SESSION["s"]["module"]["name"])) {
46+
header("Location: ../index.php");
47+
exit;
48+
}
49+
50+
$app->uses('listform_actions');
51+
$app->listform_actions->onLoad();
52+
53+
54+
?>

0 commit comments

Comments
 (0)