diff --git a/interface/web/client/client_edit.php b/interface/web/client/client_edit.php
index 9200440348f5478668a9c54affefdd1882319caf..a35b6639a21b9d6ec1c020e082a2ea4dc5729c9a 100644
--- a/interface/web/client/client_edit.php
+++ b/interface/web/client/client_edit.php
@@ -50,7 +50,39 @@ $app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
-
+
+
+ function onShowEnd() {
+
+ global $app;
+
+ $sql = "SELECT template_id,template_name FROM client_template WHERE template_type = 'a'";
+ $tpls = $app->db->queryAllRecords($sql);
+ $option = '';
+ $tpl = array();
+ foreach($tpls as $item){
+ $option .= '';
+ $tpl[$item['template_id']] = $item['template_name'];
+ }
+ $app->tpl->setVar('tpl_add_select',$option);
+
+ $sql = "SELECT template_additional FROM client WHERE client_id = " . $this->id;
+ $result = $app->db->queryOneRecord($sql);
+ $tplAdd = explode("/", $result['template_additional']);
+ $text = '';
+ foreach($tplAdd as $item){
+ if (trim($item) != ''){
+ if ($text != '') $text .= '
';
+ $text .= $tpl[$item];
+ }
+ }
+
+ $app->tpl->setVar('template_additional_list', $text);
+
+ parent::onShowEnd();
+
+ }
+
/*
This function is called automatically right after
the data was successful inserted in the database.
@@ -87,6 +119,8 @@ class page_action extends tform_actions {
/* If there is a client-template, process it */
applyClientTemplates($this->id);
+
+ parent::onAfterInsert();
}
@@ -127,6 +161,8 @@ class page_action extends tform_actions {
/*
* If there is a client-template, process it */
applyClientTemplates($this->id);
+
+ parent::onAfterUpdate();
}
}
diff --git a/interface/web/client/client_template_edit.php b/interface/web/client/client_template_edit.php
index 6ae45880c3f97c0cc94b7fdc3a4d84e091b85dbb..7368063ec54f830aaea2af6fc2ccfda76bfdd0dd 100644
--- a/interface/web/client/client_template_edit.php
+++ b/interface/web/client/client_template_edit.php
@@ -62,10 +62,16 @@ class page_action extends tform_actions {
/*
* the template has changed. apply the new data to all clients
*/
- $sql = "SELECT client_id FROM client WHERE template_master = " . $this->id;
+ if ($this->dataRecord["template_type"] == 'm'){
+ $sql = "SELECT client_id FROM client WHERE template_master = " . $this->id;
+ } else {
+ $sql = "SELECT client_id FROM client WHERE template_additional LIKE '%/" . $this->id . '/%"';
+ }
$clients = $app->db->queryAllRecords($sql);
- foreach ($clients as $client){
- applyClientTemplates($client['client_id']);
+ if (is_array($clients)){
+ foreach ($clients as $client){
+ applyClientTemplates($client['client_id']);
+ }
}
}
}
diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php
index c0e4571d55cbb5ecd3158d9dca5c8e1c509186d2..8be3de8a2e328d45f33532e9dcf39436d2da6b6e 100644
--- a/interface/web/client/form/client.tform.php
+++ b/interface/web/client/form/client.tform.php
@@ -308,6 +308,10 @@ $form["tabs"]['limits'] = array (
),
'value' => array('0' => 'custom')
),
+ 'template_additional' => array (
+ 'datatype' => 'VARCHAR',
+ 'formtype' => 'TEXT',
+ ),
'default_mailserver' => array (
'datatype' => 'INTEGER',
'formtype' => 'SELECT',
diff --git a/interface/web/client/form/client_template.tform.php b/interface/web/client/form/client_template.tform.php
index 71146bd2d79a5074945c1b1554f721ef1f4cb327..f732faf577aa4ac70a17fdb3d1fbd11bcecd6513 100644
--- a/interface/web/client/form/client_template.tform.php
+++ b/interface/web/client/form/client_template.tform.php
@@ -107,7 +107,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_maildomain_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -121,7 +121,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailbox_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -135,7 +135,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailalias_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -149,7 +149,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailforward_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -163,7 +163,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailcatchall_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -191,7 +191,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailfilter_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -205,7 +205,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailfetchmail_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -219,7 +219,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_mailquota_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -233,7 +233,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_spamfilter_wblist_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -247,7 +247,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_spamfilter_user_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -261,7 +261,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_spamfilter_policy_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -275,7 +275,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_web_domain_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -289,7 +289,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_web_aliasdomain_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -303,7 +303,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_web_subdomain_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -317,7 +317,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_ftp_user_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -331,7 +331,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_shell_user_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -345,7 +345,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_dns_zone_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -359,7 +359,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_dns_record_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
@@ -387,7 +387,7 @@ $form["tabs"]['limits'] = array (
'validators' => array ( 0 => array ( 'type' => 'ISINT',
'errmsg'=> 'limit_database_error_notint'),
),
- 'default' => '-1',
+ 'default' => '0',
'value' => '',
'separator' => '',
'width' => '10',
diff --git a/interface/web/client/templates/client_edit_limits.htm b/interface/web/client/templates/client_edit_limits.htm
index 8792e00f1de84903ee4658d17938b63715d576b7..5e4232b9aeab6e53b28f3b86117e90975688e434 100644
--- a/interface/web/client/templates/client_edit_limits.htm
+++ b/interface/web/client/templates/client_edit_limits.htm
@@ -9,6 +9,17 @@
+