Commit 3d229b05 authored by tbrehm's avatar tbrehm

Added: FS#613 - Add email domain aliases

parent 35a8f56d
......@@ -69,6 +69,7 @@ CREATE TABLE `client` (
`limit_maildomain` int(11) NOT NULL default '-1',
`limit_mailbox` int(11) NOT NULL default '-1',
`limit_mailalias` int(11) NOT NULL default '-1',
`limit_mailaliasdomain` int(11) NOT NULL default '-1',
`limit_mailforward` int(11) NOT NULL default '-1',
`limit_mailcatchall` int(11) NOT NULL default '-1',
`limit_mailrouting` int(11) NOT NULL default '0',
......@@ -125,6 +126,7 @@ CREATE TABLE `client_template` (
`limit_maildomain` int(11) NOT NULL default '-1',
`limit_mailbox` int(11) NOT NULL default '-1',
`limit_mailalias` int(11) NOT NULL default '-1',
`limit_mailaliasdomain` int(11) NOT NULL default '-1',
`limit_mailforward` int(11) NOT NULL default '-1',
`limit_mailcatchall` int(11) NOT NULL default '-1',
`limit_mailrouting` int(11) NOT NULL default '0',
......@@ -389,7 +391,7 @@ CREATE TABLE `mail_forwarding` (
`server_id` int(11) unsigned NOT NULL default '0',
`source` varchar(255) NOT NULL,
`destination` text NOT NULL default '',
`type` enum('alias','forward','catchall') NOT NULL default 'alias',
`type` enum('alias','aliasdomain','forward','catchall') NOT NULL default 'alias',
`active` enum('n','y') NOT NULL,
PRIMARY KEY (`forwarding_id`),
KEY `server_id` (`server_id`,`source`)
......
......@@ -364,6 +364,20 @@ $form["tabs"]['limits'] = array (
'rows' => '',
'cols' => ''
),
'limit_mailaliasdomain' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailaliasdomain_error_notint'),
),
'default' => '-1',
'value' => '',
'separator' => '',
'width' => '10',
'maxlength' => '10',
'rows' => '',
'cols' => ''
),
'limit_mailforward' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
......
......@@ -143,6 +143,20 @@ $form["tabs"]['limits'] = array (
'rows' => '',
'cols' => ''
),
'limit_mailaliasdomain' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailaliasdomain_error_notint'),
),
'default' => '-1',
'value' => '',
'separator' => '',
'width' => '10',
'maxlength' => '10',
'rows' => '',
'cols' => ''
),
'limit_mailforward' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
......
......@@ -2,6 +2,7 @@
$wb["limit_maildomain_txt"] = 'Max. number of email domains';
$wb["limit_mailbox_txt"] = 'Max. number of mailboxes';
$wb["limit_mailalias_txt"] = 'Max. number of email aliases';
$wb["limit_mailaliasdomain_txt"] = 'Max. number of domain aliases';
$wb["limit_mailforward_txt"] = 'Max. number of email forwarders';
$wb["limit_mailcatchall_txt"] = 'Max. number of email catchall accounts';
$wb["limit_mailrouting_txt"] = 'Max. number of email routes';
......@@ -61,6 +62,7 @@ $wb["username_error_unique"] = 'The username must be unique.';
$wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.';
$wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.';
$wb["limit_mailalias_error_notint"] = 'The email alias limit must be a number.';
$wb["limit_mailaliasdomain_error_notint"] = 'The email domain alias limit must be a number.';
$wb["limit_mailforward_error_notint"] = 'The email forward limit must be a number.';
$wb["limit_mailcatchall_error_notint"] = 'The email catchall limit must be a number.';
$wb["limit_mailrouting_error_notint"] = 'The email routing limit must be a number.';
......
<?php
$wb["limit_client_error_notint"] = 'Client Limit is not a number.';
$wb["limit_maildomain_txt"] = 'Max. number of email domains';
$wb["limit_mailbox_txt"] = 'Max. number of mailboxes';
$wb["limit_mailalias_txt"] = 'Max. number of email aliases';
$wb["limit_mailforward_txt"] = 'Max. number of email forwarders';
$wb["limit_mailcatchall_txt"] = 'Max. number of email catchall accounts';
$wb["limit_mailrouting_txt"] = 'Max. number of email routes';
$wb["limit_mailfilter_txt"] = 'Max. number of email filters';
$wb["limit_fetchmail_txt"] = 'Max. number of fetchmail accounts';
$wb["limit_mailquota_txt"] = 'Mailbox quota';
$wb["limit_spamfilter_wblist_txt"] = 'Max. number of spamfilter white / blacklist filters';
$wb["limit_spamfilter_user_txt"] = 'Max. number of spamfilter users';
$wb["limit_spamfilter_policy_txt"] = 'Max. number of spamfilter policys';
$wb["limit_domain_txt"] = 'limit_domain';
$wb["limit_subdomain_txt"] = 'limit_subdomain';
$wb["limit_webquota_txt"] = 'limit_webquota';
$wb["limit_database_txt"] = 'limit_database';
$wb["limit_cron_txt"] = 'Max. number of cron jobs';
$wb["limit_cron_type_txt"] = 'Max. type of cron jobs (chrooted and full implies url)';
$wb["limit_cron_frequency_txt"] = 'Min. delay between executions';
$wb["limit_web_domain_txt"] = 'Max. number of web domains';
$wb["limit_web_aliasdomain_txt"] = 'Max. number of web aliasdomains';
$wb["limit_web_subdomain_txt"] = 'Max. number of web subdomains';
$wb["limit_ftp_user_txt"] = 'Max. number of FTP users';
$wb["limit_dns_zone_txt"] = 'Max. number of DNS zones';
$wb["limit_dns_record_txt"] = 'Max. number DNS records';
$wb["limit_shell_user_txt"] = 'Max. number of Shell users';
$wb["limit_client_txt"] = 'Max. number of Clients';
$wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.';
$wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.';
$wb["limit_mailalias_error_notint"] = 'The email alias limit must be a number.';
$wb["limit_mailforward_error_notint"] = 'The email forward limit must be a number.';
$wb["limit_mailcatchall_error_notint"] = 'The email catchall limit must be a number.';
$wb["limit_mailrouting_error_notint"] = 'The email routing limit must be a number.';
$wb["limit_mailfilter_error_notint"] = 'The email filter limit must be a number.';
$wb["limit_mailfetchmail_error_notint"] = 'The fetchmail limit must be a number.';
$wb["limit_mailquota_error_notint"] = 'The email quota limit must be a number.';
$wb["limit_spamfilter_wblist_error_notint"] = 'The spamfilter white / blacklist limit must be a number.';
$wb["limit_spamfilter_user_error_notint"] = 'The spamfilter user limit must be a number.';
$wb["limit_spamfilter_policy_error_notint"] = 'The spamfilter policy limit must be a number.';
$wb["limit_web_domain_error_notint"] = 'The website limit must be a number.';
$wb["limit_web_aliasdomain_error_notint"] = 'The website alias domain limit must be a number.';
$wb["limit_web_subdomain_error_notint"] = 'The website subdomain limit must be a number.';
$wb["limit_ftp_user_error_notint"] = 'The ftp user limit must be a number.';
$wb["limit_shell_user_error_notint"] = 'The shell user limit must be a number.';
$wb["limit_dns_zone_error_notint"] = 'The dns zone limit must be a number.';
$wb["limit_dns_zone_error_notint"] = 'The dns record limit must be a number.';
$wb["limit_database_txt"] = 'Max. number of Databases';
$wb["limit_database_error_notint"] = 'The database limit must be a number.';
$wb["limit_cron_error_notint"] = 'The cron limit must be a number.';
$wb["limit_cron_error_frequency"] = 'The cron frequency limit must be a number.';
$wb["error_template_name_empty"] = 'Please enter a Template name';
<?php
$wb["limit_client_error_notint"] = 'Client Limit is not a number.';
$wb["limit_maildomain_txt"] = 'Max. number of email domains';
$wb["limit_mailbox_txt"] = 'Max. number of mailboxes';
$wb["limit_mailalias_txt"] = 'Max. number of email aliases';
$wb["limit_mailaliasdomain_txt"] = 'Max. number of domain aliases';
$wb["limit_mailforward_txt"] = 'Max. number of email forwarders';
$wb["limit_mailcatchall_txt"] = 'Max. number of email catchall accounts';
$wb["limit_mailrouting_txt"] = 'Max. number of email routes';
$wb["limit_mailfilter_txt"] = 'Max. number of email filters';
$wb["limit_fetchmail_txt"] = 'Max. number of fetchmail accounts';
$wb["limit_mailquota_txt"] = 'Mailbox quota';
$wb["limit_spamfilter_wblist_txt"] = 'Max. number of spamfilter white / blacklist filters';
$wb["limit_spamfilter_user_txt"] = 'Max. number of spamfilter users';
$wb["limit_spamfilter_policy_txt"] = 'Max. number of spamfilter policys';
$wb["limit_domain_txt"] = 'limit_domain';
$wb["limit_subdomain_txt"] = 'limit_subdomain';
$wb["limit_webquota_txt"] = 'limit_webquota';
$wb["limit_database_txt"] = 'limit_database';
$wb["limit_cron_txt"] = 'Max. number of cron jobs';
$wb["limit_cron_type_txt"] = 'Max. type of cron jobs (chrooted and full implies url)';
$wb["limit_cron_frequency_txt"] = 'Min. delay between executions';
$wb["limit_web_domain_txt"] = 'Max. number of web domains';
$wb["limit_web_aliasdomain_txt"] = 'Max. number of web aliasdomains';
$wb["limit_web_subdomain_txt"] = 'Max. number of web subdomains';
$wb["limit_ftp_user_txt"] = 'Max. number of FTP users';
$wb["limit_dns_zone_txt"] = 'Max. number of DNS zones';
$wb["limit_dns_record_txt"] = 'Max. number DNS records';
$wb["limit_shell_user_txt"] = 'Max. number of Shell users';
$wb["limit_client_txt"] = 'Max. number of Clients';
$wb["limit_maildomain_error_notint"] = 'The email domain limit must be a number.';
$wb["limit_mailbox_error_notint"] = 'The mailbox limit must be a number.';
$wb["limit_mailalias_error_notint"] = 'The email alias limit must be a number.';
$wb["limit_mailaliasdomain_error_notint"] = 'The email domain alias limit must be a number.';
$wb["limit_mailforward_error_notint"] = 'The email forward limit must be a number.';
$wb["limit_mailcatchall_error_notint"] = 'The email catchall limit must be a number.';
$wb["limit_mailrouting_error_notint"] = 'The email routing limit must be a number.';
$wb["limit_mailfilter_error_notint"] = 'The email filter limit must be a number.';
$wb["limit_mailfetchmail_error_notint"] = 'The fetchmail limit must be a number.';
$wb["limit_mailquota_error_notint"] = 'The email quota limit must be a number.';
$wb["limit_spamfilter_wblist_error_notint"] = 'The spamfilter white / blacklist limit must be a number.';
$wb["limit_spamfilter_user_error_notint"] = 'The spamfilter user limit must be a number.';
$wb["limit_spamfilter_policy_error_notint"] = 'The spamfilter policy limit must be a number.';
$wb["limit_web_domain_error_notint"] = 'The website limit must be a number.';
$wb["limit_web_aliasdomain_error_notint"] = 'The website alias domain limit must be a number.';
$wb["limit_web_subdomain_error_notint"] = 'The website subdomain limit must be a number.';
$wb["limit_ftp_user_error_notint"] = 'The ftp user limit must be a number.';
$wb["limit_shell_user_error_notint"] = 'The shell user limit must be a number.';
$wb["limit_dns_zone_error_notint"] = 'The dns zone limit must be a number.';
$wb["limit_dns_zone_error_notint"] = 'The dns record limit must be a number.';
$wb["limit_database_txt"] = 'Max. number of Databases';
$wb["limit_database_error_notint"] = 'The database limit must be a number.';
$wb["limit_cron_error_notint"] = 'The cron limit must be a number.';
$wb["limit_cron_error_frequency"] = 'The cron frequency limit must be a number.';
$wb["error_template_name_empty"] = 'Please enter a Template name';
?>
\ No newline at end of file
......@@ -53,6 +53,10 @@
<label for="limit_mailalias">{tmpl_var name='limit_mailalias_txt'}</label>
<input name="limit_mailalias" id="limit_mailalias" value="{tmpl_var name='limit_mailalias'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
</div>
<div class="ctrlHolder">
<label for="limit_mailaliasdomain">{tmpl_var name='limit_mailaliasdomain_txt'}</label>
<input name="limit_mailaliasdomain" id="limit_mailaliasdomain" value="{tmpl_var name='limit_mailaliasdomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
</div>
<div class="ctrlHolder">
<label for="limit_mailforward">{tmpl_var name='limit_mailforward_txt'}</label>
<input name="limit_mailforward" id="limit_mailforward" value="{tmpl_var name='limit_mailforward'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
......
......@@ -18,6 +18,10 @@
<input name="limit_mailalias" id="limit_mailalias" value="{tmpl_var name='limit_mailalias'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
</div>
<div class="ctrlHolder">
<label for="limit_mailaliasdomain">{tmpl_var name='limit_mailaliasdomain_txt'}</label>
<input name="limit_mailaliasdomain" id="limit_mailaliasdomain" value="{tmpl_var name='limit_mailaliasdomain'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
</div>
<div class="ctrlHolder">
<label for="limit_mailforward">{tmpl_var name='limit_mailforward_txt'}</label>
<input name="limit_mailforward" id="limit_mailforward" value="{tmpl_var name='limit_mailforward'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
</div>
......
<?php
/*
Form Definition
Tabledefinition
Datatypes:
- INTEGER (Forces the input to Int)
- DOUBLE
- CURRENCY (Formats the values to currency notation)
- VARCHAR (no format check, maxlength: 255)
- TEXT (no format check)
- DATE (Dateformat, automatic conversion to timestamps)
Formtype:
- TEXT (Textfield)
- TEXTAREA (Textarea)
- PASSWORD (Password textfield, input is not shown when edited)
- SELECT (Select option field)
- RADIO
- CHECKBOX
- CHECKBOXARRAY
- FILE
VALUE:
- Wert oder Array
Hint:
The ID field of the database table is not part of the datafield definition.
The ID field must be always auto incement (int or bigint).
*/
$form["title"] = "Domain Alias";
$form["description"] = "";
$form["name"] = "mail_aliasdomain";
$form["action"] = "mail_aliasdomain_edit.php";
$form["db_table"] = "mail_forwarding";
$form["db_table_idx"] = "forwarding_id";
$form["db_history"] = "yes";
$form["tab_default"] = "alias";
$form["list_default"] = "mail_aliasdomain_list.php";
$form["auth"] = 'yes'; // yes / no
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['alias'] = array (
'title' => "Domain Alias",
'width' => 100,
'template' => "templates/mail_aliasdomain_edit.htm",
'fields' => array (
##################################
# Begin Datatable fields
##################################
'server_id' => array (
'datatype' => 'INTEGER',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'source' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'source_error_empty'),
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'source_error_unique'),
2 => array ( 'type' => 'REGEX',
'regex' => '/^\@[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
'errmsg'=> 'source_error_regex'),
),
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'destination' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => '',
'value' => array('alias' => 'Alias','forward'=>'Forward')
),
'active' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array(0 => 'n',1 => 'y')
),
##################################
# ENDE Datatable fields
##################################
)
);
?>
\ No newline at end of file
<?php
$wb["source_txt"] = 'Source';
$wb["destination_txt"] = 'Destination';
$wb["active_txt"] = 'Active';
$wb["no_domain_perm"] = "You have no permission for this domain.";
$wb["limit_mailaliasdomain_txt"] = 'The max. number of email alias domains for your account is reached.';
$wb["source_destination_identical_txt"] = 'Source and target Domain are the same.';
$wb["source_error_empty"] = 'Source Domain is empty.';
$wb["source_error_unique"] = 'Duplicate source Domain.';
$wb["source_error_regex"] = 'Invalid source domain name.';
?>
\ No newline at end of file
<?php
$wb["list_head_txt"] = 'Domain alias';
$wb["active_txt"] = 'Active';
$wb["source_txt"] = 'Source';
$wb["destination_txt"] = 'Destination';
$wb["source_txt"] = 'Source';
$wb["add_new_record_txt"] = 'Add new Domain alias';
?>
\ No newline at end of file
......@@ -14,6 +14,10 @@ $items[] = array( 'title' => 'Domain',
'target' => 'content',
'link' => 'mail/mail_domain_list.php');
$items[] = array( 'title' => 'Domain Alias',
'target' => 'content',
'link' => 'mail/mail_aliasdomain_list.php');
$items[] = array( 'title' => 'Email Mailbox',
'target' => 'content',
'link' => 'mail/mail_user_list.php');
......
<?php
/*
Datatypes:
- INTEGER
- DOUBLE
- CURRENCY
- VARCHAR
- TEXT
- DATE
*/
// Name of the list
$liste["name"] = "mail_aliasdomain";
// Database table
$liste["table"] = "mail_forwarding";
// Index index field of the database table
$liste["table_idx"] = "forwarding_id";
// Search Field Prefix
$liste["search_prefix"] = "search_";
// Records per page
$liste["records_per_page"] = 15;
// Script File of the list
$liste["file"] = "mail_aliasdomain_list.php";
// Script file of the edit form
$liste["edit_file"] = "mail_aliasdomain_edit.php";
// Script File of the delete script
$liste["delete_file"] = "mail_aliasdomain_del.php";
// Paging Template
$liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"] = "yes";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array( 'field' => "active",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'n' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>"));
$liste["item"][] = array( 'field' => "source",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "destination",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
?>
\ No newline at end of file
<?php
/*
Copyright (c) 2005, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/mail_aliasdomain.list.php";
$tform_def_file = "form/mail_aliasdomain.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
//* Check permissions for module
$app->auth->check_module_permissions('mail');
$app->uses("tform_actions");
$app->tform_actions->onDelete();
?>
\ No newline at end of file
<?php
/*
Copyright (c) 2005 - 2009, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$tform_def_file = "form/mail_aliasdomain.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
//* Check permissions for module
$app->auth->check_module_permissions('mail');
// Loading classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
function onShowNew() {
global $app, $conf;
// we will check only users, not admins
if($_SESSION["s"]["user"]["typ"] == 'user') {
if(!$app->tform->checkClientLimit('limit_mailaliasdomain',"type = 'aliasdomain'")) {
$app->error($app->tform->wordbook["limit_mailaliasdomain_txt"]);
}
if(!$app->tform->checkResellerLimit('limit_mailaliasdomain',"type = 'aliasdomain'")) {
$app->error('Reseller: '.$app->tform->wordbook["limit_mailaliasdomain_txt"]);
}
}
parent::onShowNew();
}
function onShowEnd() {
global $app, $conf;
$source_domain = substr($this->dataRecord["source"],1);
$destination_domain = substr($this->dataRecord["destination"],1);
// Getting Domains of the user
$sql = "SELECT domain FROM mail_domain WHERE ".$app->tform->getAuthSQL('r').' ORDER BY domain';
$domains = $app->db->queryAllRecords($sql);
$source_select = '';
$destination_select = '';
if(is_array($domains)) {
foreach( $domains as $domain) {
$selected = ($domain["domain"] == @$source_domain)?'SELECTED':'';
$source_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
$selected = ($domain["domain"] == @$destination_domain)?'SELECTED':'';
$destination_select .= "<option value='$domain[domain]' $selected>$domain[domain]</option>\r\n";
}
}
$app->tpl->setVar("source_domain",$source_select);