Skip to content

Commit fe670c6

Browse files
committed
Added SOAP support for mail module. Many thanks to Arkadiusz Roch & Artur Edelman from Tri-Plex technology
1 parent 98a9088 commit fe670c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2704
-11
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 575 additions & 8 deletions
Large diffs are not rendered by default.

interface/lib/classes/remoting_lib.inc.php

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2727
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
2828
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
30+
--UPDATED 08.2009--
31+
Full SOAP support for ISPConfig 3.1.4 b
32+
Updated by Arkadiusz Roch & Artur Edelman
33+
Copyright (c) Tri-Plex technology
34+
2935
*/
3036

3137
/**
@@ -61,7 +67,7 @@
6167
*/
6268

6369
class remoting_lib {
64-
70+
6571
/**
6672
* Definition of the database atble (array)
6773
* @var tableDef
@@ -600,7 +606,23 @@ function getDataRecord($primary_id) {
600606
$sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id;
601607
return $app->db->queryOneRecord($sql);
602608
}
603-
609+
610+
function dodaj_usera($params,$insert_id){
611+
global $app,$sql1;
612+
$username = $params["username"];
613+
$password = $params["password"];
614+
$modules = 'mail,sites,dns,tools';
615+
$startmodule = 'mail';
616+
$usertheme = $params["usertheme"];
617+
$type = 'user';
618+
$active = 1;
619+
$language = $params["language"];
620+
$groupid = $app->db->datalogInsert('sys_group', "(name,description,client_id) VALUES ('$username','','$insert_id')", 'groupid');
621+
$groups = $groupid;
622+
$sql1 = "INSERT INTO sys_user (username,passwort,modules,startmodule,app_theme,typ,active,language,groups,default_group,client_id)
623+
VALUES ('$username',md5('$password'),'$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,$insert_id)";
624+
$app->db->query($sql1);
625+
}
604626

605627
function datalogSave($action,$primary_id, $record_old, $record_new) {
606628
global $app,$conf;
@@ -689,4 +711,4 @@ function datalogSave($action,$primary_id, $record_old, $record_new) {
689711

690712
}
691713

692-
?>
714+
?>
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
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+
$lista_funkcji = array();
37+
$lista_funkcji['mail_domain_get,mail_domain_add,mail_domain_update,mail_domain_delete'] = 'Mail domain functions<br>';
38+
39+
$lista_funkcji['mail_user_add,mail_user_update,mail_user_delete'] = 'Mail user functions<br>';
40+
41+
$lista_funkcji['mail_alias_add,mail_alias_update,mail_alias_delete'] = 'Mail alias functions<br>';
42+
43+
$lista_funkcji['mail_forward_add,mail_forward_update,mail_forward_delete'] = 'Mail forward functions<br>';
44+
45+
$lista_funkcji['mail_catchall_add,mail_catchall_update,mail_catchall_delete'] = 'Mail catchall functions<br>';
46+
47+
$lista_funkcji['mail_transport_add,mail_transport_update,mail_transport_delete'] = 'Mail transport functions<br>';
48+
49+
$lista_funkcji['mail_whitelist_add,mail_whitelist_update,mail_whitelist_delete'] = 'Mail whitelist functions<br>';
50+
51+
$lista_funkcji['mail_blacklist_add,mail_blacklist_update,mail_blacklist_delete'] = 'Mail blacklist functions<br>';
52+
53+
$lista_funkcji['mail_spamfilter_user_add,mail_spamfilter_user_update,mail_spamfilter_user_delete'] = 'Mail spamfilter user functions<br>';
54+
55+
$lista_funkcji['mail_policy_add,mail_policy_update,mail_policy_delete'] = 'Mail spamfilter policy functions<br>';
56+
57+
$lista_funkcji['mail_fetchmail_add,mail_fetchmail_update,mail_fetchmail_delete'] = 'Mail fetchmail functions<br>';
58+
59+
$lista_funkcji['mail_whitelist_add,mail_whitelist_update,mail_whitelist_delete'] = 'Mail whitelist functions<br>';
60+
61+
$lista_funkcji['mail_blacklist_add,mail_blacklist_update,mail_blacklist_delete'] = 'Mail blacklist functions<br>';
62+
63+
$lista_funkcji['mail_filter_add,mail_filter_update,mail_filter_delete'] = 'Mail filter functions<br>';
64+
65+
66+
67+
$form["title"] = "Remote user";
68+
$form["description"] = "";
69+
$form["name"] = "remote_user";
70+
$form["action"] = "remote_user_edit.php";
71+
$form["db_table"] = "remote_user";
72+
$form["db_table_idx"] = "remote_userid";
73+
$form["db_history"] = "yes";
74+
$form["tab_default"] = "remote_user";
75+
$form["list_default"] = "remote_user_list.php";
76+
$form["auth"] = 'yes'; // yes / no
77+
78+
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
79+
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
80+
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
81+
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
82+
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
83+
84+
$form["tabs"]['remote_user'] = array (
85+
'title' => "Remote User",
86+
'width' => 100,
87+
'template' => "templates/remote_user_edit.htm",
88+
'fields' => array (
89+
##################################
90+
# Begin Datatable fields
91+
##################################
92+
'remote_userid' => array (
93+
'datatype' => 'INTEGER',
94+
'formtype' => 'SELECT',
95+
'default' => '',
96+
'datasource' => array ( 'type' => 'SQL',
97+
'querystring' => 'SELECT remote_userid,remote_username FROM remote_user WHERE {AUTHSQL} ORDER BY remote_username',
98+
'keyfield'=> 'remote_userid',
99+
'valuefield'=> 'remote_username'
100+
),
101+
'value' => ''
102+
),
103+
104+
'remote_username' => array (
105+
'datatype' => 'VARCHAR',
106+
'formtype' => 'TEXT',
107+
'validators' => array ( 0 => array ( 'type' => 'UNIQUE',
108+
'errmsg'=> 'username_error_unique'),
109+
1 => array ( 'type' => 'REGEX',
110+
'regex' => '/^[\w\.\-]{0,64}$/',
111+
'errmsg'=> 'username_error_regex'),
112+
2 => array ( 'type' => 'NOTEMPTY',
113+
'errmsg'=> 'username_error_empty'),
114+
),
115+
'default' => '',
116+
'value' => '',
117+
'width' => '30',
118+
'maxlength' => '255'
119+
),
120+
'remote_password' => array (
121+
'datatype' => 'VARCHAR',
122+
'formtype' => 'PASSWORD',
123+
'encryption' => 'MD5',
124+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
125+
'errmsg'=> 'password_error_empty'),
126+
),
127+
'default' => '',
128+
'value' => '',
129+
'width' => '30',
130+
'maxlength' => '255'
131+
),
132+
'remote_functions' => array (
133+
'datatype' => 'TEXT',
134+
'formtype' => 'CHECKBOXARRAY',
135+
'regex' => '',
136+
'errmsg' => '',
137+
'default' => '',
138+
'value' => $lista_funkcji,
139+
'separator' => ';',
140+
'width' => '',
141+
'maxlength' => '',
142+
'rows' => '5',
143+
'cols' => '30'
144+
)
145+
146+
##################################
147+
# ENDE Datatable fields
148+
##################################
149+
)
150+
);
151+
152+
153+
154+
155+
156+
?>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
$wb['username_txt'] = 'Username:';
3+
$wb['password_txt'] = 'Password:';
4+
$wb['function_txt'] = 'Functions:';
5+
$wb['username_error_unique'] = 'Username must be unique';
6+
$wb['username_error_empty'] = 'Username cannot be empty';
7+
$wb['password_error_empty'] = 'Password cannot be empty';
8+
$wb['password_strength_txt'] = 'Password Strength:';
9+
?>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
$wb['list_head_txt'] = "Remote Users";
3+
$wb['list_desc_txt'] = "";
4+
$wb['add_new_record_txt'] = "Add new user";
5+
$wb['parent_remote_userid_txt'] = 'ID';
6+
$wb['username_txt'] = "Username";
7+
?>
8+

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,22 @@
138138
// cleanup
139139
unset($items);
140140

141+
$items[] = array( 'title' => 'Add user',
142+
'target' => 'content',
143+
'link' => 'admin/remote_user_edit.php');
144+
145+
$items[] = array( 'title' => 'Edit user',
146+
'target' => 'content',
147+
'link' => 'admin/remote_user_list.php');
148+
149+
150+
$module['nav'][] = array( 'title' => 'Remote Users',
151+
'open' => 1,
152+
'items' => $items);
153+
154+
// cleanup
155+
unset($items);
156+
141157
// Getting the admin options from other modules
142158
$modules = explode(',', $_SESSION['s']['user']['modules']);
143159
if(is_array($modules)) {
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
// Name of the list
4+
$liste['name'] = 'remote_user';
5+
6+
// Database table
7+
$liste['table'] = 'remote_user';
8+
9+
// Index index field of the database table
10+
$liste['table_idx'] = 'userid';
11+
12+
// Search Field Prefix
13+
$liste['search_prefix'] = 'search_';
14+
15+
// Records per page
16+
$liste['records_per_page']= 15;
17+
18+
// Script File of the list
19+
$liste['file'] = 'remote_user_list.php';
20+
21+
// Script file of the edit form
22+
$liste['edit_file'] = 'remote_user_edit.php';
23+
24+
// Script File of the delete script
25+
$liste['delete_file'] = 'remote_user_del.php';
26+
27+
// Paging Template
28+
$liste['paging_tpl'] = 'templates/paging.tpl.htm';
29+
30+
// Enable auth
31+
$liste['auth'] = 'yes';
32+
33+
34+
//****** Search fields
35+
36+
$liste['item'][] = array(
37+
'field' => 'remote_userid',
38+
'datatype' => 'VARCHAR',
39+
'formtype' => 'SELECT',
40+
'op' => '=',
41+
'prefix' => '',
42+
'suffix' => '',
43+
'width' => '',
44+
'datasource' => array(
45+
'type' => 'SQL',
46+
'querystring' => 'SELECT remote_userid,remote_username FROM remote_user WHERE {AUTHSQL} ORDER BY remote_username',
47+
'keyfield' => 'remote_userid',
48+
'valuefield' => 'remote_userid'
49+
),
50+
'value' => ''
51+
);
52+
53+
$liste['item'][] = array(
54+
'field' => 'remote_username',
55+
'datatype' => 'VARCHAR',
56+
'formtype' => 'TEXT',
57+
'op' => 'like',
58+
'prefix' => '%',
59+
'suffix' => '%',
60+
'width' => '',
61+
'value' => ''
62+
);
63+
64+
?>
65+
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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/remote_user.list.php";
36+
$tform_def_file = "form/remote_user.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+
//* Check permissions for module
46+
$app->auth->check_module_permissions('admin');
47+
48+
$app->uses('tpl,tform');
49+
$app->load('tform_actions');
50+
51+
// Create a class page_action that extends the tform_actions base class
52+
53+
class page_action extends tform_actions {
54+
55+
56+
// Customisations for the page actions will be defined here
57+
58+
}
59+
$page = new page_action;
60+
$page->onDelete();
61+
62+
?>

0 commit comments

Comments
 (0)