Skip to content

Commit 32b40db

Browse files
committed
Added getmail module.
1 parent 62a1108 commit 32b40db

File tree

18 files changed

+787
-76
lines changed

18 files changed

+787
-76
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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"] = "Get Email";
37+
$form["description"] = "";
38+
$form["name"] = "mail_get";
39+
$form["action"] = "mail_get_edit.php";
40+
$form["db_table"] = "mail_get";
41+
$form["db_table_idx"] = "mailget_id";
42+
$form["db_history"] = "yes";
43+
$form["tab_default"] = "mailget";
44+
$form["list_default"] = "mail_get_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"]['mailget'] = array (
54+
'title' => "Get email",
55+
'width' => 100,
56+
'template' => "templates/mail_get_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 {AUTHSQL} ORDER BY server_name',
67+
'keyfield'=> 'server_id',
68+
'valuefield'=> 'server_name'
69+
),
70+
'value' => ''
71+
),
72+
'type' => array (
73+
'datatype' => 'VARCHAR',
74+
'formtype' => 'SELECT',
75+
'default' => '',
76+
'value' => array('pop3' => 'POP3','imap'=>'IMAP')
77+
),
78+
'source_server' => array (
79+
'datatype' => 'VARCHAR',
80+
'formtype' => 'TEXT',
81+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
82+
'errmsg'=> 'source_server_error_isempty'),
83+
),
84+
'default' => '',
85+
'value' => '',
86+
'width' => '30',
87+
'maxlength' => '255'
88+
),
89+
'source_username' => array (
90+
'datatype' => 'VARCHAR',
91+
'formtype' => 'TEXT',
92+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
93+
'errmsg'=> 'source_username_error_isempty'),
94+
),
95+
'default' => '',
96+
'value' => '',
97+
'width' => '30',
98+
'maxlength' => '255'
99+
),
100+
'source_password' => array (
101+
'datatype' => 'VARCHAR',
102+
'formtype' => 'TEXT',
103+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
104+
'errmsg'=> 'source_password_error_isempty'),
105+
),
106+
'default' => '',
107+
'value' => '',
108+
'width' => '30',
109+
'maxlength' => '255'
110+
),
111+
'source_delete' => array (
112+
'datatype' => 'VARCHAR',
113+
'formtype' => 'CHECKBOX',
114+
'default' => 'y',
115+
'value' => array(0 => 'n',1 => 'y')
116+
),
117+
'destination' => array (
118+
'datatype' => 'VARCHAR',
119+
'formtype' => 'SELECT',
120+
'default' => '',
121+
'datasource' => array ( 'type' => 'SQL',
122+
'querystring' => 'SELECT email FROM mail_user WHERE {AUTHSQL} ORDER BY email',
123+
'keyfield' => 'email',
124+
'valuefield' => 'email'
125+
),
126+
'validators' => array ( 0 => array ( 'type' => 'ISEMAIL',
127+
'errmsg'=> 'destination_error_isemail'),
128+
),
129+
'value' => ''
130+
),
131+
'active' => array (
132+
'datatype' => 'VARCHAR',
133+
'formtype' => 'CHECKBOX',
134+
'default' => 'y',
135+
'value' => array(0 => 'n',1 => 'y')
136+
),
137+
##################################
138+
# ENDE Datatable fields
139+
##################################
140+
)
141+
);
142+
143+
144+
145+
?>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
$wb["server_id_txt"] = 'server_id';
3+
$wb["type_txt"] = 'type';
4+
$wb["source_server_txt"] = 'source_server';
5+
$wb["source_username_txt"] = 'source_username';
6+
$wb["source_password_txt"] = 'source_password';
7+
$wb["source_delete_txt"] = 'source_delete';
8+
$wb["destination_txt"] = 'destination';
9+
$wb["active_txt"] = 'active';
10+
$wb["btn_save_txt"] = 'Save';
11+
$wb["btn_cancel_txt"] = 'Cancel';
12+
?>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
$wb["list_head_txt"] = 'mail_get';
3+
$wb["active_txt"] = 'active';
4+
$wb["server_id_txt"] = 'server_id';
5+
$wb["source_server_txt"] = 'source_server';
6+
$wb["source_username_txt"] = 'source_username';
7+
$wb["destination_txt"] = 'destination';
8+
$wb["page_txt"] = 'Page';
9+
$wb["page_of_txt"] = 'of';
10+
$wb["page_next_txt"] = 'Next';
11+
$wb["page_back_txt"] = 'Back';
12+
$wb["delete_txt"] = 'Delete';
13+
$wb["filter_txt"] = 'Filter';
14+
?>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22
$module = array (
33
'name' => 'mail',
44
'title' => 'Email',
@@ -112,12 +112,12 @@
112112
array (
113113
0 =>
114114
array (
115-
'title' => 'Fetchmail Accounts',
115+
'title' => 'Fetchmail',
116116
'target' => 'content',
117-
'link' => 'mail/fetchmail_list.php',
117+
'link' => 'mail/mail_get_list.php',
118118
),
119119
),
120120
),
121121
),
122-
)
122+
)
123123
?>
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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"] = "mail_get";
17+
18+
// Database table
19+
$liste["table"] = "mail_get";
20+
21+
// Index index field of the database table
22+
$liste["table_idx"] = "mailget_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"] = "mail_get_list.php";
32+
33+
// Script file of the edit form
34+
$liste["edit_file"] = "mail_get_edit.php";
35+
36+
// Script File of the delete script
37+
$liste["delete_file"] = "mail_get_del.php";
38+
39+
// Paging Template
40+
$liste["paging_tpl"] = "templates/paging.tpl.htm";
41+
42+
// Enable auth
43+
$liste["auth"] = "yes";
44+
45+
46+
/*****************************************************
47+
* Suchfelder
48+
*****************************************************/
49+
50+
$liste["item"][] = array( 'field' => "active",
51+
'datatype' => "VARCHAR",
52+
'formtype' => "SELECT",
53+
'op' => "=",
54+
'prefix' => "",
55+
'suffix' => "",
56+
'width' => "",
57+
'value' => array('y' => "Yes",'n' => "No"));
58+
59+
$liste["item"][] = array( 'field' => "server_id",
60+
'datatype' => "VARCHAR",
61+
'formtype' => "SELECT",
62+
'op' => "like",
63+
'prefix' => "%",
64+
'suffix' => "%",
65+
'datasource' => array ( 'type' => 'SQL',
66+
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
67+
'keyfield'=> 'server_id',
68+
'valuefield'=> 'server_name'
69+
),
70+
'width' => "",
71+
'value' => "");
72+
73+
$liste["item"][] = array( 'field' => "source_server",
74+
'datatype' => "VARCHAR",
75+
'formtype' => "TEXT",
76+
'op' => "like",
77+
'prefix' => "%",
78+
'suffix' => "%",
79+
'width' => "",
80+
'value' => "");
81+
82+
$liste["item"][] = array( 'field' => "source_username",
83+
'datatype' => "VARCHAR",
84+
'formtype' => "TEXT",
85+
'op' => "like",
86+
'prefix' => "%",
87+
'suffix' => "%",
88+
'width' => "",
89+
'value' => "");
90+
91+
$liste["item"][] = array( 'field' => "destination",
92+
'datatype' => "VARCHAR",
93+
'formtype' => "TEXT",
94+
'op' => "like",
95+
'prefix' => "%",
96+
'suffix' => "%",
97+
'width' => "",
98+
'value' => "");
99+
100+
101+
?>
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) 2007, 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/mail_get.list.php";
36+
$tform_def_file = "form/mail_get.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+
?>

0 commit comments

Comments
 (0)