From 348aef798afc67d45e60022b40a2a5becac8ebc4 Mon Sep 17 00:00:00 2001 From: tbrehm Date: Wed, 23 Nov 2005 23:33:07 +0000 Subject: [PATCH] added mail_box --- interface/lib/classes/tform.inc.php | 25 +++-- interface/lib/classes/tform_actions.inc.php | 3 +- interface/sql/ispconfig3db.sql | 49 ++++++++- interface/web/sites/form/mail_box.tform.php | 43 +++++++- interface/web/sites/lib/lang/en_mail_box.lng | 13 +++ .../web/sites/lib/lang/en_mail_box_list.lng | 12 ++ interface/web/sites/lib/module.conf.php | 2 +- interface/web/sites/list/mail_box.list.php | 69 ++++++++++++ interface/web/sites/mail_box_del.php | 54 +++++++++ interface/web/sites/mail_box_edit.php | 104 ++++++++++++++++++ interface/web/sites/mail_box_list.php | 26 +++++ .../templates/mail_box_autoresponder_edit.htm | 21 ++++ .../web/sites/templates/mail_box_list.htm | 27 +++++ .../sites/templates/mail_box_mailbox_edit.htm | 24 ++++ interface/web/themes/default/style.css | 2 +- 15 files changed, 455 insertions(+), 19 deletions(-) create mode 100644 interface/web/sites/lib/lang/en_mail_box.lng create mode 100644 interface/web/sites/lib/lang/en_mail_box_list.lng create mode 100644 interface/web/sites/list/mail_box.list.php create mode 100644 interface/web/sites/mail_box_del.php create mode 100644 interface/web/sites/mail_box_edit.php create mode 100644 interface/web/sites/mail_box_list.php create mode 100644 interface/web/sites/templates/mail_box_autoresponder_edit.htm create mode 100644 interface/web/sites/templates/mail_box_list.htm create mode 100644 interface/web/sites/templates/mail_box_mailbox_edit.htm diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php index 5fb64445f..a58200c05 100644 --- a/interface/lib/classes/tform.inc.php +++ b/interface/lib/classes/tform.inc.php @@ -101,7 +101,7 @@ class tform { * der Variablen mit Regex * @var errorMessage */ - var $errorMessage; + var $errorMessage = ''; var $dateformat = "d.m.Y"; var $formDef; @@ -456,7 +456,7 @@ class tform { function encode($record,$tab) { if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab ist leer oder existiert nicht (TAB: $tab)."); - $this->errorMessage = ''; + //$this->errorMessage = ''; if(is_array($record)) { foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) { @@ -556,14 +556,12 @@ class tform { $this->errorMessage .= $this->wordbook[$errmsg]."
\r\n"; } break; - /* case 'ISEMAIL': - if(!preg_match("", $field_value)) { + if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{2,4}$/i", $field_value)) { $errmsg = $validator['errmsg']; $this->errorMessage .= $this->wordbook[$errmsg]."
\r\n"; } break; - */ case 'ISINT': $tmpval = intval($field_value); if($tmpval === 0 and !empty($field_value)) { @@ -631,14 +629,22 @@ class tform { if($action == "INSERT") { if($field['formtype'] == 'PASSWORD') { $sql_insert_key .= "`$key`, "; - $sql_insert_val .= "md5('".$record[$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') { - $sql_update .= "`$key` = md5('".$record[$key]."'), "; + if($field['encryption'] == 'CRYPT') { + $sql_update .= "`$key` = '".crypt($record[$key])."', "; + } else { + $sql_update .= "`$key` = md5('".$record[$key]."'), "; + } } else { $sql_update .= "`$key` = '".$record[$key]."', "; } @@ -835,9 +841,12 @@ class tform { } 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"]["userid"] == $_SESSION["s"]["user"]["groupid"] && stristr($perm,$this->formDef["auth_preset"]["perm_group"])) $result = true; + if($this->formDef["auth_preset"]["groupid"] == $_SESSION["s"]["user"]["groupid"] && stristr($perm,$this->formDef["auth_preset"]["perm_group"])) $result = true; if(@stristr($perm,$this->formDef["auth_preset"]["perm_other"])) $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) $result = true; + return $result; } diff --git a/interface/lib/classes/tform_actions.inc.php b/interface/lib/classes/tform_actions.inc.php index a13a8fe6f..5eb8ad669 100644 --- a/interface/lib/classes/tform_actions.inc.php +++ b/interface/lib/classes/tform_actions.inc.php @@ -71,6 +71,7 @@ class tform_actions { $this->id = intval($_REQUEST["id"]); if(count($_POST) > 1) { + $this->dataRecord = $_POST; $this->onSubmit(); } else { $this->onShow(); @@ -84,8 +85,6 @@ class tform_actions { function onSubmit() { global $app, $conf; - $this->dataRecord = $_POST; - // Calling the action functions if($this->id > 0) { $this->onUpdate(); diff --git a/interface/sql/ispconfig3db.sql b/interface/sql/ispconfig3db.sql index 590243f23..08a880d54 100644 --- a/interface/sql/ispconfig3db.sql +++ b/interface/sql/ispconfig3db.sql @@ -3,9 +3,9 @@ # http://www.phpmyadmin.net/ (download page) # # Host: localhost -# Erstellungszeit: 23. November 2005 um 18:15 -# Server Version: 4.0.22 -# PHP-Version: 5.0.2 +# Erstellungszeit: 24. November 2005 um 00:31 +# Server Version: 4.0.23 +# PHP-Version: 5.0.3 # Datenbank: `ispconfig3` # -------------------------------------------------------- @@ -13,6 +13,7 @@ # Tabellenstruktur für Tabelle `mail_blacklist` # +DROP TABLE IF EXISTS mail_blacklist; CREATE TABLE mail_blacklist ( blacklist_id int(11) NOT NULL auto_increment, server_id int(11) NOT NULL default '0', @@ -31,6 +32,7 @@ CREATE TABLE mail_blacklist ( # Tabellenstruktur für Tabelle `mail_box` # +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', @@ -49,7 +51,7 @@ CREATE TABLE mail_box ( quota varchar(255) NOT NULL default '', cc varchar(50) NOT NULL default '', forward varchar(50) NOT NULL default '', - autoresponder enum('yes','no') NOT NULL default 'no', + autoresponder enum('0','1') NOT NULL default '0', autoresponder_text tinytext NOT NULL, active enum('0','1') NOT NULL default '1', antivirus enum('yes','no') NOT NULL default 'no', @@ -63,12 +65,14 @@ CREATE TABLE mail_box ( # Daten für Tabelle `mail_box` # +INSERT INTO mail_box VALUES (1, 1, 0, 'riud', 'riud', '', 1, 'till@test.de', '$1$ye3.TQ1.$v/RvqbuU.Gh7UrLlA6HqX/', '', '', 0, 0, '', '', '', '', '0', '', '1', 'no', 'no', 'no'); # -------------------------------------------------------- # # 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', @@ -98,6 +102,7 @@ INSERT INTO mail_domain VALUES (2, 1, 0, 'riud', 'riud', '', 1, 'test2.de', 'ali # Tabellenstruktur für Tabelle `mail_domain_catchall` # +DROP TABLE IF EXISTS mail_domain_catchall; CREATE TABLE mail_domain_catchall ( virtual_default_id int(11) NOT NULL auto_increment, server_id int(11) NOT NULL default '0', @@ -117,6 +122,7 @@ CREATE TABLE mail_domain_catchall ( # 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, @@ -138,6 +144,7 @@ CREATE TABLE 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', @@ -159,6 +166,7 @@ CREATE TABLE mail_mailman_domain ( # Tabellenstruktur für Tabelle `mail_redirect` # +DROP TABLE IF EXISTS mail_redirect; CREATE TABLE mail_redirect ( email_id int(11) NOT NULL auto_increment, sys_userid int(11) NOT NULL default '0', @@ -185,6 +193,7 @@ CREATE TABLE mail_redirect ( # Tabellenstruktur für Tabelle `mail_whitelist` # +DROP TABLE IF EXISTS mail_whitelist; CREATE TABLE mail_whitelist ( whitelist_id int(11) NOT NULL auto_increment, server_id int(11) NOT NULL default '0', @@ -203,6 +212,7 @@ CREATE TABLE mail_whitelist ( # Tabellenstruktur für Tabelle `reseller` # +DROP TABLE IF EXISTS reseller; CREATE TABLE reseller ( reseller_id bigint(20) NOT NULL auto_increment, sys_userid int(11) NOT NULL default '0', @@ -247,6 +257,7 @@ CREATE TABLE reseller ( # 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', @@ -277,6 +288,7 @@ INSERT INTO server VALUES (1, 1, 1, 'riud', 'riud', '', 'Server 1', 1, 0, 0, 0, # Tabellenstruktur für Tabelle `sys_datalog` # +DROP TABLE IF EXISTS sys_datalog; CREATE TABLE sys_datalog ( datalog_id bigint(20) NOT NULL auto_increment, dbtable varchar(255) NOT NULL default '', @@ -295,12 +307,38 @@ CREATE TABLE sys_datalog ( INSERT INTO sys_datalog VALUES (1, 'mail_domain', 'domain_id:0', 'i', 1132758298, 'admin', 'a:5:{s:9:"server_id";a:2:{s:3:"old";N;s:3:"new";i:1;}s:6:"domain";a:2:{s:3:"old";N;s:3:"new";s:7:"test.de";}s:11:"destination";a:2:{s:3:"old";N;s:3:"new";s:8:"hallo.de";}s:4:"type";a:2:{s:3:"old";N;s:3:"new";s:5:"alias";}s:6:"active";a:2:{s:3:"old";N;s:3:"new";i:1;}}'); INSERT INTO sys_datalog VALUES (2, 'mail_domain', 'domain_id:2', 'u', 1132759303, 'admin', 'a:1:{s:6:"domain";a:2:{s:3:"old";s:7:"test.de";s:3:"new";s:8:"test2.de";}}'); INSERT INTO sys_datalog VALUES (3, 'mail_domain', 'domain_id:2', 'u', 1132759328, 'admin', 'a:1:{s:11:"destination";a:2:{s:3:"old";s:8:"hallo.de";s:3:"new";s:7:"test.de";}}'); +INSERT INTO sys_datalog VALUES (4, 'mail_box', 'mailbox_id:0', 'i', 1132775402, 'admin', 'a:3:{s:5:"email";a:2:{s:3:"old";N;s:3:"new";s:12:"till@test.de";}s:8:"cryptpwd";a:2:{s:3:"old";N;s:3:"new";s:5:"hallo";}s:6:"active";a:2:{s:3:"old";N;s:3:"new";i:1;}}'); +INSERT INTO sys_datalog VALUES (5, 'mail_box', 'mailbox_id:1', 'u', 1132775575, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (6, 'mail_box', 'mailbox_id:1', 'u', 1132775587, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (7, 'mail_box', 'mailbox_id:1', 'u', 1132775898, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (8, 'mail_box', 'mailbox_id:1', 'u', 1132775901, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (9, 'mail_box', 'mailbox_id:1', 'u', 1132777011, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (10, 'mail_box', 'mailbox_id:1', 'u', 1132777757, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (11, 'mail_box', 'mailbox_id:1', 'u', 1132777760, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (12, 'mail_box', 'mailbox_id:1', 'u', 1132777764, 'admin', 'a:2:{s:5:"email";a:2:{s:3:"old";s:12:"till@test.de";s:3:"new";s:13:"till2@test.de";}s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (13, 'mail_box', 'mailbox_id:1', 'u', 1132777768, 'admin', 'a:2:{s:5:"email";a:2:{s:3:"old";s:13:"till2@test.de";s:3:"new";s:12:"till@test.de";}s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (14, 'mail_box', 'mailbox_id:1', 'u', 1132778380, 'admin', 'a:2:{s:9:"server_id";a:2:{s:3:"old";s:1:"0";s:3:"new";i:1;}s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (15, 'mail_box', 'mailbox_id:1', 'u', 1132784990, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (16, 'mail_box', 'mailbox_id:0', 'i', 1132785424, 'admin', 'a:3:{s:9:"server_id";a:2:{s:3:"old";N;s:3:"new";i:1;}s:5:"email";a:2:{s:3:"old";N;s:3:"new";s:8:"@test.de";}s:6:"active";a:2:{s:3:"old";N;s:3:"new";i:1;}}'); +INSERT INTO sys_datalog VALUES (17, 'mail_box', 'mailbox_id:1', 'u', 1132786068, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (18, 'mail_box', 'mailbox_id:1', 'u', 1132786083, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (19, 'mail_box', 'mailbox_id:1', 'u', 1132786772, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (20, 'mail_box', 'mailbox_id:1', 'u', 1132786777, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:32:"598d4c200461b81522a3328565c25f7c";s:3:"new";s:4:"test";}}'); +INSERT INTO sys_datalog VALUES (21, 'mail_box', 'mailbox_id:1', 'u', 1132786796, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:0:"";s:3:"new";s:4:"test";}}'); +INSERT INTO sys_datalog VALUES (22, 'mail_box', 'mailbox_id:1', 'u', 1132786860, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:0:"";s:3:"new";s:4:"test";}}'); +INSERT INTO sys_datalog VALUES (23, 'mail_box', 'mailbox_id:1', 'u', 1132787252, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:0:"";s:3:"new";s:4:"test";}}'); +INSERT INTO sys_datalog VALUES (24, 'mail_box', 'mailbox_id:1', 'u', 1132787548, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:34:"$1$ye3.TQ1.$v/RvqbuU.Gh7UrLlA6HqX/";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (25, 'mail_box', 'mailbox_id:1', 'u', 1132787761, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:34:"$1$ye3.TQ1.$v/RvqbuU.Gh7UrLlA6HqX/";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (26, 'mail_box', 'mailbox_id:0', 'i', 1132787775, 'admin', 'a:3:{s:9:"server_id";a:2:{s:3:"old";N;s:3:"new";i:1;}s:5:"email";a:2:{s:3:"old";N;s:3:"new";s:12:"test@test.de";}s:6:"active";a:2:{s:3:"old";N;s:3:"new";i:1;}}'); +INSERT INTO sys_datalog VALUES (27, 'mail_box', 'mailbox_id:1', 'u', 1132788121, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:34:"$1$ye3.TQ1.$v/RvqbuU.Gh7UrLlA6HqX/";s:3:"new";s:0:"";}}'); +INSERT INTO sys_datalog VALUES (28, 'mail_box', 'mailbox_id:1', 'u', 1132788482, 'admin', 'a:1:{s:8:"cryptpwd";a:2:{s:3:"old";s:34:"$1$ye3.TQ1.$v/RvqbuU.Gh7UrLlA6HqX/";s:3:"new";s:0:"";}}'); # -------------------------------------------------------- # # Tabellenstruktur für Tabelle `sys_dbsync` # +DROP TABLE IF EXISTS sys_dbsync; CREATE TABLE sys_dbsync ( id bigint(20) NOT NULL auto_increment, jobname varchar(255) NOT NULL default '', @@ -329,6 +367,7 @@ CREATE TABLE sys_dbsync ( # Tabellenstruktur für Tabelle `sys_filesync` # +DROP TABLE IF EXISTS sys_filesync; CREATE TABLE sys_filesync ( id bigint(20) NOT NULL auto_increment, jobname varchar(255) NOT NULL default '', @@ -353,6 +392,7 @@ CREATE TABLE sys_filesync ( # Tabellenstruktur für Tabelle `sys_group` # +DROP TABLE IF EXISTS sys_group; CREATE TABLE sys_group ( groupid int(11) NOT NULL auto_increment, name varchar(255) NOT NULL default '', @@ -372,6 +412,7 @@ INSERT INTO sys_group VALUES (2, 'user', 'Users Group'); # Tabellenstruktur für Tabelle `sys_user` # +DROP TABLE IF EXISTS sys_user; CREATE TABLE sys_user ( userid int(11) NOT NULL auto_increment, sys_userid int(11) NOT NULL default '0', diff --git a/interface/web/sites/form/mail_box.tform.php b/interface/web/sites/form/mail_box.tform.php index 5f2c9402c..68c28a224 100644 --- a/interface/web/sites/form/mail_box.tform.php +++ b/interface/web/sites/form/mail_box.tform.php @@ -53,16 +53,24 @@ $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = $form["tabs"]['mailbox'] = array ( 'title' => "Mailbox", 'width' => 100, - 'template' => "templates/mail_box_edit.htm", + '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' => 'NOTEMPTY', - 'errmsg'=> 'email_error_empty'), + 'validators' => array ( 0 => array ( 'type' => 'ISEMAIL', + 'errmsg'=> 'email_error_isemail'), 1 => array ( 'type' => 'UNIQUE', 'errmsg'=> 'email_error_unique'), ), @@ -74,6 +82,7 @@ $form["tabs"]['mailbox'] = array ( 'cryptpwd' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'PASSWORD', + 'encryption'=> 'CRYPT', 'default' => '', 'value' => '', 'width' => '30', @@ -91,5 +100,33 @@ $form["tabs"]['mailbox'] = array ( ) ); +$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/lib/lang/en_mail_box.lng b/interface/web/sites/lib/lang/en_mail_box.lng new file mode 100644 index 000000000..ff001ff5a --- /dev/null +++ b/interface/web/sites/lib/lang/en_mail_box.lng @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/lang/en_mail_box_list.lng b/interface/web/sites/lib/lang/en_mail_box_list.lng new file mode 100644 index 000000000..f0ecd365e --- /dev/null +++ b/interface/web/sites/lib/lang/en_mail_box_list.lng @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/interface/web/sites/lib/module.conf.php b/interface/web/sites/lib/module.conf.php index b3072291d..5a06587c2 100644 --- a/interface/web/sites/lib/module.conf.php +++ b/interface/web/sites/lib/module.conf.php @@ -36,7 +36,7 @@ $module = array ( array ( 'title' => 'Email Mailbox', 'target' => 'content', - 'link' => '', + 'link' => 'sites/mail_box_list.php', ), 4 => array ( diff --git a/interface/web/sites/list/mail_box.list.php b/interface/web/sites/list/mail_box.list.php new file mode 100644 index 000000000..d15d32148 --- /dev/null +++ b/interface/web/sites/list/mail_box.list.php @@ -0,0 +1,69 @@ + "email", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "autoresponder", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + + +?> \ No newline at end of file diff --git a/interface/web/sites/mail_box_del.php b/interface/web/sites/mail_box_del.php new file mode 100644 index 000000000..9c50e1120 --- /dev/null +++ b/interface/web/sites/mail_box_del.php @@ -0,0 +1,54 @@ +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/sites/mail_box_edit.php new file mode 100644 index 000000000..715964f23 --- /dev/null +++ b/interface/web/sites/mail_box_edit.php @@ -0,0 +1,104 @@ +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 .= "\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"]."
"; + } + + // 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(); + } + +} + +$page = new page_action; +$page->onLoad(); + +?> \ No newline at end of file diff --git a/interface/web/sites/mail_box_list.php b/interface/web/sites/mail_box_list.php new file mode 100644 index 000000000..ae55a7ac1 --- /dev/null +++ b/interface/web/sites/mail_box_list.php @@ -0,0 +1,26 @@ +uses('listform_actions'); + +$app->listform_actions->onLoad(); + + +?> \ No newline at end of file diff --git a/interface/web/sites/templates/mail_box_autoresponder_edit.htm b/interface/web/sites/templates/mail_box_autoresponder_edit.htm new file mode 100644 index 000000000..9769d04f8 --- /dev/null +++ b/interface/web/sites/templates/mail_box_autoresponder_edit.htm @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + +
{tmpl_var name='autoresponder_txt'}:{tmpl_var name='autoresponder'}
{tmpl_var name='autoresponder_text_txt'}:
  
  + +
+ \ No newline at end of file diff --git a/interface/web/sites/templates/mail_box_list.htm b/interface/web/sites/templates/mail_box_list.htm new file mode 100644 index 000000000..36987ecab --- /dev/null +++ b/interface/web/sites/templates/mail_box_list.htm @@ -0,0 +1,27 @@ +
+

+

+ + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="email"}{tmpl_var name="autoresponder"}[{tmpl_var name='delete_txt'}]
+
\ No newline at end of file diff --git a/interface/web/sites/templates/mail_box_mailbox_edit.htm b/interface/web/sites/templates/mail_box_mailbox_edit.htm new file mode 100644 index 000000000..1466e1759 --- /dev/null +++ b/interface/web/sites/templates/mail_box_mailbox_edit.htm @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + +
{tmpl_var name='email_txt'}: @
{tmpl_var name='cryptpwd_txt'}:
{tmpl_var name='active_txt'}:{tmpl_var name='active'}
  
  + +
+ \ No newline at end of file diff --git a/interface/web/themes/default/style.css b/interface/web/themes/default/style.css index b8fd5af3b..f7e8c93c8 100644 --- a/interface/web/themes/default/style.css +++ b/interface/web/themes/default/style.css @@ -152,7 +152,7 @@ textarea,input.text,select,option{ .frmTextHead { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; - font-size: 14px; + font-size: 20px; color: #496FA8; text-decoration: none; -- GitLab