Till Brehm
2014-01-10 94c9617ebd5497ae8801a0c6e4b30999fcf23872
- Added support for reseller templates.
- Resellers can use templates for their clients.
32 files modified
261 ■■■■ changed files
interface/lib/classes/client_templates.inc.php 4 ●●● patch | view | raw | blame | history
interface/lib/classes/custom_datasource.inc.php 2 ●●● patch | view | raw | blame | history
interface/web/client/client_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/client/client_template_edit.php 12 ●●●●● patch | view | raw | blame | history
interface/web/client/form/client_template.tform.php 14 ●●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/ar.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/bg.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/br.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/cz.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/de.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/el.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/en.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/es.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/fi.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/fr.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/hr.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/hu.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/id.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/ja.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/nl.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/pl.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/pt.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/ro.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/ru.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/se.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/sk.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/tr.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/module.conf.php 15 ●●●●● patch | view | raw | blame | history
interface/web/client/reseller_edit.php 47 ●●●●● patch | view | raw | blame | history
interface/web/client/templates/client_edit_limits.htm 9 ●●●● patch | view | raw | blame | history
interface/web/client/templates/client_template_edit_limits.htm 8 ●●●● patch | view | raw | blame | history
interface/web/client/templates/reseller_edit_limits.htm 79 ●●●● patch | view | raw | blame | history
interface/lib/classes/client_templates.inc.php
@@ -106,9 +106,10 @@
        /*
         * Get the master-template for the client
         */
        $sql = "SELECT template_master, template_additional FROM client WHERE client_id = " . $app->functions->intval($clientId);
        $sql = "SELECT template_master, template_additional,limit_client FROM client WHERE client_id = " . $app->functions->intval($clientId);
        $record = $app->db->queryOneRecord($sql);
        $masterTemplateId = $record['template_master'];
        $is_reseller = ($record['limit_client'] > 0)?true:false;
        if($record['template_additional'] != '') {
            // we have to call the update_client_templates function
@@ -222,6 +223,7 @@
         * Write all back to the database
         */
        $update = '';
        if(!$is_reseller) unset($limits['limit_client']); // Only Resellers may have limit_client set in template to ensure that we do not convert a client to reseller accidently.
        foreach($limits as $k => $v){
            if ((strpos($k, 'limit') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec') && !is_array($v)){
                if ($update != '') $update .= ', ';
interface/lib/classes/custom_datasource.inc.php
@@ -32,7 +32,7 @@
    function master_templates($field, $record) {
        global $app, $conf;
        $records = $app->db->queryAllRecords("SELECT template_id,template_name FROM client_template WHERE template_type ='m'");
        $records = $app->db->queryAllRecords("SELECT template_id,template_name FROM client_template WHERE template_type ='m' and ".$app->tform->getAuthSQL('r'));
        $records_new[0] = $app->lng('Custom');
        foreach($records as $rec) {
            $key = $rec['template_id'];
interface/web/client/client_edit.php
@@ -92,6 +92,11 @@
                }
            }
        }
        //* Resellers shall not be able to create another reseller
        if($_SESSION["s"]["user"]["typ"] == 'user') {
            $this->dataRecord['limit_client'] = 0;
        }
        if($this->id != 0) {
            $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ' . $this->id);
interface/web/client/client_template_edit.php
@@ -51,6 +51,18 @@
class page_action extends tform_actions {
    function onSubmit() {
        global $app;
        //* Resellers shall not be able to create another reseller
        if($_SESSION["s"]["user"]["typ"] == 'user') {
            $this->dataRecord['limit_client'] = 0;
        }
        parent::onSubmit();
    }
    function onBeforeUpdate() {
        global $app;
interface/web/client/form/client_template.tform.php
@@ -101,6 +101,20 @@
        //#################################
        // Begin Datatable fields
        //#################################
        'limit_client' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'ISINT',
                    'errmsg'=> 'limit_client_error_notint'),
            ),
            'default' => '1',
            'value'  => '',
            'separator' => '',
            'width'  => '10',
            'maxlength' => '10',
            'rows'  => '',
            'cols'  => ''
        ),
        'limit_maildomain' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
interface/web/client/lib/lang/ar.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Add Client';
$wb['Edit Client'] = 'Edit Client';
$wb['Clients'] = 'Clients';
$wb['Edit Client-Templates'] = 'Edit Client-Templates';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Add Reseller';
$wb['Edit Reseller'] = 'Edit Reseller';
$wb['Resellers'] = 'Resellers';
interface/web/client/lib/lang/bg.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Добавяне на клиент';
$wb['Edit Client'] = 'Редактиране на клиент';
$wb['Clients'] = 'Клиенти';
$wb['Edit Client-Templates'] = 'Редактирай Клиентски-Шаблон';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Добави дистрибутор';
$wb['Edit Reseller'] = 'Редактирай дистрибутор';
$wb['Resellers'] = 'Дистрибутори';
interface/web/client/lib/lang/br.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Adcionar Cliente';
$wb['Edit Client'] = 'Editar Cliente';
$wb['Clients'] = 'Clientes';
$wb['Edit Client-Templates'] = 'Editar Gabaritos de Clientes';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Adcionar Revendedor';
$wb['Edit Reseller'] = 'Editar Revendedor';
$wb['Resellers'] = 'Revendedores';
interface/web/client/lib/lang/cz.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Přidat klienta';
$wb['Edit Client'] = 'Upravit klienta';
$wb['Clients'] = 'Klienti';
$wb['Edit Client-Templates'] = 'Upravit klientské šablony';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Přidat distributora';
$wb['Edit Reseller'] = 'Upravit distributora';
$wb['Resellers'] = 'Distributoři (prodejci)';
interface/web/client/lib/lang/de.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Kunde hinzufügen';
$wb['Edit Client'] = 'Kunde bearbeiten';
$wb['Clients'] = 'Kunden';
$wb['Edit Client-Templates'] = 'Kundenvorlagen';
$wb['Templates'] = 'Vorlagen';
$wb['Limit-Templates'] = 'Kundenvorlagen';
$wb['Add Reseller'] = 'Reseller hinzufügen';
$wb['Edit Reseller'] = 'Reseller bearbeiten';
$wb['Resellers'] = 'Reseller';
interface/web/client/lib/lang/el.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Νέος Πελάτης';
$wb['Edit Client'] = 'Επεξεργασία Πελάτη';
$wb['Clients'] = 'Πελάτες';
$wb['Edit Client-Templates'] = 'Επεξεργασία προτύπων πελατών';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Νέος Μεταπωλητής';
$wb['Edit Reseller'] = 'Επεξεργασία Μεταπωλητή';
$wb['Resellers'] = 'Μεταπωλητές';
interface/web/client/lib/lang/en.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Add Client';
$wb['Edit Client'] = 'Edit Client';
$wb['Clients'] = 'Clients';
$wb['Edit Client-Templates'] = 'Edit Client-Templates';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Add Reseller';
$wb['Edit Reseller'] = 'Edit Reseller';
$wb['Resellers'] = 'Resellers';
interface/web/client/lib/lang/es.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Añadir cliente';
$wb['Edit Client'] = 'Editar cliente';
$wb['Clients'] = 'Clientes';
$wb['Edit Client-Templates'] = 'Editar plantillas de clientes';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Añadir revendedor';
$wb['Edit Reseller'] = 'Editar revendedor';
$wb['Resellers'] = 'Revendedores';
interface/web/client/lib/lang/fi.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Lisää asiakas';
$wb['Edit Client'] = 'Muokkaa asiakkaan tietoja';
$wb['Clients'] = 'Asiakkaat';
$wb['Edit Client-Templates'] = 'Muokkaa asiakasmalleja';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Lisää uusi jälleenmyyjä';
$wb['Edit Reseller'] = 'Muokkaa jälleenmyyjää';
$wb['Resellers'] = 'Jälleenmyyjät';
interface/web/client/lib/lang/fr.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Ajouter un Client';
$wb['Edit Client'] = 'Editer un Client';
$wb['Clients'] = 'Clients';
$wb['Edit Client-Templates'] = 'Editer les modèles de Clients';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Ajouter un Revendeur';
$wb['Edit Reseller'] = 'Editer un Revendeur';
$wb['Resellers'] = 'Revendeurs';
interface/web/client/lib/lang/hr.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Dodaj klijenta';
$wb['Edit Client'] = 'Editiraj klijenta';
$wb['Clients'] = 'Klijenti';
$wb['Edit Client-Templates'] = 'Editiraj predložak za klijente';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Dodaj preprodavača';
$wb['Edit Reseller'] = 'Editiraj preprodavača';
$wb['Resellers'] = 'Preprodavači';
interface/web/client/lib/lang/hu.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Ügyfél hozzáadása';
$wb['Edit Client'] = 'Ügyfél adatok szerkesztése';
$wb['Clients'] = 'Ügyfelek';
$wb['Edit Client-Templates'] = 'Ügyfél-Sablonok szerkesztése';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Új Viszonteladó';
$wb['Edit Reseller'] = 'Viszonteladók szerkesztése';
$wb['Resellers'] = 'Viszonteladók';
interface/web/client/lib/lang/id.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Tambah Klien';
$wb['Edit Client'] = 'Sunting Klien';
$wb['Clients'] = 'Klien';
$wb['Edit Client-Templates'] = 'Sunting Template Klien';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Tambah Reseller';
$wb['Edit Reseller'] = 'Sunting Reseller';
$wb['Resellers'] = 'Reseller';
interface/web/client/lib/lang/ja.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'クライアントを追加する';
$wb['Edit Client'] = 'クライアントを編集する';
$wb['Clients'] = 'クライアント';
$wb['Edit Client-Templates'] = 'クライアントテンプレートを編集する';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'リセラーを追加する';
$wb['Edit Reseller'] = 'リセラーを編集する';
$wb['Resellers'] = 'リセラー';
interface/web/client/lib/lang/nl.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Toevoegen klant';
$wb['Edit Client'] = 'Wijzigen klant';
$wb['Clients'] = 'klanten';
$wb['Edit Client-Templates'] = 'Wijzig klant-template';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Toevoegen Reseller';
$wb['Edit Reseller'] = 'Wijzigen Reseller';
$wb['Resellers'] = 'Resellers';
interface/web/client/lib/lang/pl.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Dodaj klienta';
$wb['Edit Client'] = 'Edytuj klienta';
$wb['Clients'] = 'Klienci';
$wb['Edit Client-Templates'] = 'Edytuj szablony klientów';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Dodaj Resellera';
$wb['Edit Reseller'] = 'Edytuj Resellera';
$wb['Resellers'] = 'Resellerzy';
interface/web/client/lib/lang/pt.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Adicionar Cliente';
$wb['Edit Client'] = 'Editar Cliente';
$wb['Clients'] = 'Clientes';
$wb['Edit Client-Templates'] = 'Editar Templates de Clientes';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Adicionar Revendedor';
$wb['Edit Reseller'] = 'Editar Revendedor';
$wb['Resellers'] = 'Revendedores';
interface/web/client/lib/lang/ro.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Add Client';
$wb['Edit Client'] = 'Edit Client';
$wb['Clients'] = 'Clients';
$wb['Edit Client-Templates'] = 'Edit Client-Templates';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Add Reseller';
$wb['Edit Reseller'] = 'Edit Reseller';
$wb['Resellers'] = 'Resellers';
interface/web/client/lib/lang/ru.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Добавить клиента';
$wb['Edit Client'] = 'Изменить клиента';
$wb['Clients'] = 'Клиенты';
$wb['Edit Client-Templates'] = 'Изменить шаблон клиента';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Добавить реселлера';
$wb['Edit Reseller'] = 'Изменить реселлера';
$wb['Resellers'] = 'Реселлеры';
interface/web/client/lib/lang/se.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Add Client';
$wb['Edit Client'] = 'Edit Client';
$wb['Clients'] = 'Clients';
$wb['Edit Client-Templates'] = 'Edit Client-Templates';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Add Reseller';
$wb['Edit Reseller'] = 'Edit Reseller';
$wb['Resellers'] = 'Resellers';
interface/web/client/lib/lang/sk.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Pridať klienta';
$wb['Edit Client'] = 'Upraviť klienta';
$wb['Clients'] = 'Klienti';
$wb['Edit Client-Templates'] = 'Upraviť klient-Šablónu';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Pridať nového predajcu';
$wb['Edit Reseller'] = 'Upraviť predajcu';
$wb['Resellers'] = 'Predajcovia';
interface/web/client/lib/lang/tr.lng
@@ -5,7 +5,8 @@
$wb['Add Client'] = 'Müşteri Ekle';
$wb['Edit Client'] = 'Müşteri Düzenle';
$wb['Clients'] = 'Müşteriler';
$wb['Edit Client-Templates'] = 'Müşteri-Şablon Düzenle';
$wb['Templates'] = 'Templates';
$wb['Limit-Templates'] = 'Limit-Templates';
$wb['Add Reseller'] = 'Reseller Ekle';
$wb['Edit Reseller'] = 'Reseller Düzenle';
$wb['Resellers'] = 'Resellerlar';
interface/web/client/lib/module.conf.php
@@ -66,6 +66,21 @@
unset($items);
//if($_SESSION["s"]["user"]["typ"] == 'admin'){
    $items[] = array(   'title'  => "Limit-Templates",
        'target'  => 'content',
        'link' => 'client/client_template_list.php',
        'html_id'   => 'client_template_list');
$module["nav"][] = array(   'title' => 'Templates',
    'open'  => 1,
    'items' => $items);
unset($items);
//}
$app->uses('ini_parser,getconf');
$settings = $app->getconf->get_global_config('domains');
interface/web/client/reseller_edit.php
@@ -94,6 +94,26 @@
                }
            }
        }
        if($this->id != 0) {
            $this->oldTemplatesAssigned = $app->db->queryAllRecords('SELECT * FROM `client_template_assigned` WHERE `client_id` = ' . $this->id);
            if(!is_array($this->oldTemplatesAssigned) || count($this->oldTemplatesAssigned) < 1) {
                // check previous type of storing templates
                $tpls = explode('/', $this->oldDataRecord['template_additional']);
                $this->oldTemplatesAssigned = array();
                foreach($tpls as $item) {
                    $item = trim($item);
                    if(!$item) continue;
                    $this->oldTemplatesAssigned[] = array('assigned_template_id' => 0, 'client_template_id' => $item, 'client_id' => $this->id);
                }
                unset($tpls);
            }
        } else {
            $this->oldTemplatesAssigned = array();
        }
        $this->_template_additional = explode('/', $this->dataRecord['template_additional']);
        $this->dataRecord['template_additional'] = '';
        parent::onSubmit();
    }
@@ -117,13 +137,27 @@
        $result = $app->db->queryAllRecords('SELECT assigned_template_id, client_template_id FROM client_template_assigned WHERE client_id = ' . $this->id);
        if($result && count($result) > 0) {
            // new style
            $items = array();
            $text = '';
            foreach($result as $item){
                if (trim($item['client_template_id']) != ''){
                    if ($text != '') $text .= '';
                    $text .= '<li rel="' . $item['assigned_template_id'] . '">' . $tpl[$item['client_template_id']]. '<a href="#" class="button icons16 icoDelete"></a></li>';
                    $text .= '<li rel="' . $item['assigned_template_id'] . '">' . $tpl[$item['client_template_id']];
                    $text .= '<a href="#" class="button icons16 icoDelete"></a>';
                    $tmp = new stdClass();
                    $tmp->id = $item['assigned_template_id'];
                    $tmp->data = '';
                    $app->plugin->raiseEvent('get_client_template_details', $tmp);
                    if($tmp->data != '') $text .= '<br /><em>' . $tmp->data . '</em>';
                    $text .= '</li>';
                    $items[] = $item['assigned_template_id'] . ':' . $item['client_template_id'];
                }
            }
            $tmprec = $app->tform->getHTML(array('template_additional' => implode('/', $items)), $this->active_tab, 'EDIT');
            $app->tpl->setVar('template_additional', $tmprec['template_additional']);
            unset($tmprec);
        } else {
            // old style
            $sql = "SELECT template_additional FROM client WHERE client_id = " . $this->id;
@@ -139,6 +173,7 @@
        }
        $app->tpl->setVar('template_additional_list', $text);
        $app->tpl->setVar('app_module', 'client');
        
        //* Set the 'customer no' default value
        if($this->id == 0) {
@@ -212,6 +247,11 @@
        $sql = "UPDATE client SET default_mailserver = $default_mailserver, default_webserver = $default_webserver, default_dnsserver = $default_dnsserver, default_slave_dnsserver = $default_dnsserver, default_dbserver = $default_dbserver WHERE client_id = ".$this->id;
        $app->db->query($sql);
        if(isset($this->dataRecord['template_master'])) {
            $app->uses('client_templates');
            $app->client_templates->update_client_templates($this->id, $this->_template_additional);
        }
        
        if($this->dataRecord['customer_no'] == $this->dataRecord['customer_no_org']) {
            //* get the system config
@@ -288,6 +328,11 @@
            $sql = "UPDATE sys_user SET modules = '$modules' WHERE client_id = $client_id";
            $app->db->query($sql);
        }
        if(isset($this->dataRecord['template_master'])) {
            $app->uses('client_templates');
            $app->client_templates->update_client_templates($this->id, $this->_template_additional);
        }
        parent::onAfterUpdate();
    }
interface/web/client/templates/client_edit_limits.htm
@@ -3,7 +3,6 @@
<div class="panel panel_client">
    <tmpl_if name="is_admin">
        <div class="pnl_toolsarea">
            <fieldset><legend>{tmpl_var name="toolsarea_head_txt"}</legend>
                <div class="buttons topbuttons">
@@ -11,11 +10,9 @@
                </div>
            </fieldset>
        </div>
    </tmpl_if>
    <div class="pnl_formsarea">
        <fieldset class="inlineLabels"><legend>Limits</legend>
            <tmpl_if name="is_admin">
                <div class="ctrlHolder">
                    <label for="template_master">{tmpl_var name='template_master_txt'}</label>
                    <select name="template_master" id="template_master" class="selectInput">
@@ -40,7 +37,6 @@
                <div class="ctrlHolder">
                    &nbsp;
                </div>
            </tmpl_if>
            <div class="subsectiontoggle"><span class="showing"></span>{tmpl_var name='web_limits_txt'}<em class="showing"></em></div>
            <div>
                <div class="ctrlHolder">
@@ -301,7 +297,7 @@
    </div>
</div>
<tmpl_if name="is_admin">
<script type="text/javascript">
<!--
function custom_template_selected() {
@@ -329,5 +325,4 @@
        });
//-->
</script>
</tmpl_if>
</script>
interface/web/client/templates/client_template_edit_limits.htm
@@ -5,7 +5,13 @@
    <div class="pnl_formsarea">
        <fieldset class="inlineLabels"><legend>Limits</legend>
            <div class="subsectiontoggle"><span class="showing"></span>{tmpl_var name='web_limits_txt'}<em class="showing"></em></div>
            <tmpl_if name="is_admin">
            <div class="ctrlHolder">
                <label for="limit_client">{tmpl_var name='limit_client_txt'}</label>
                <input name="limit_client" id="limit_client" value="{tmpl_var name='limit_client'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
            </div>
            </tmpl_if>
            <div class="subsectiontoggle"><span class="showing"></span>{tmpl_var name='web_limits_txt'}<em class="showing"></em></div>
            <div>
                <div class="ctrlHolder">
                    <label for="limit_web_domain">{tmpl_var name='limit_web_domain_txt'}</label>
interface/web/client/templates/reseller_edit_limits.htm
@@ -3,29 +3,44 @@
<div class="panel panel_client">
    <tmpl_if name="is_admin">
        <div class="pnl_toolsarea">
            <fieldset><legend>{tmpl_var name="toolsarea_head_txt"}</legend>
            <div class="buttons topbuttons">
                <button class="positive iconstxt icoAdd" type="button" value="{tmpl_var name='add_additional_template_txt'}" onclick="addAdditionalTemplate();"><span>{tmpl_var name='add_additional_template_txt'}</span></button>
            </div>
            </fieldset>
        </div>
    </tmpl_if>
    <div class="pnl_formsarea">
        <fieldset class="inlineLabels"><legend>Limits</legend>
            <!--
            <tmpl_if name="is_admin">
                  <div class="ctrlHolder">
            <tmpl_if name="is_admin">
                <div class="ctrlHolder">
                    <label for="template_master">{tmpl_var name='template_master_txt'}</label>
                    <select name="template_master" id="template_master" class="selectInput">
                                                    {tmpl_var name='template_master'}
                                            </select>
                  </div>
                  <div class="ctrlHolder">
                        {tmpl_var name='template_master'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <label for="template_additional">{tmpl_var name='template_additional_txt'}</label>
                    <select name="tpl_add_select" id="tpl_add_select" class="selectInput">
                                                    {tmpl_var name='tpl_add_select'}
                                            </select>
                          <span id="template_additional_list">{tmpl_var name='template_additional_list'}</span>
                              <input type="hidden" id="template_additional" name="template_additional" value="{tmpl_var name='template_additional'}">
                  </div>
                      <div class="ctrlHolder">
                        &nbsp;
                      </div>
                        {tmpl_var name='tpl_add_select'}
                    </select>
                </div>
                <div class="ctrlHolder">
                    <p class="label">{tmpl_var name='active_template_additional_txt'}</p>
                    <div id="template_additional_list" class="multiField">
                        <ul>
                        {tmpl_var name='template_additional_list'}
                        </ul>
                    </div>
                    <input type="hidden" id="template_additional" name="template_additional" value="{tmpl_var name='template_additional'}">
                </div>
                <div class="ctrlHolder">
                    &nbsp;
                </div>
            </tmpl_if>
            -->
            <div class="ctrlHolder">
                <label for="limit_client">{tmpl_var name='limit_client_txt'}</label>
                <input name="limit_client" id="limit_client" value="{tmpl_var name='limit_client'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
@@ -301,4 +316,34 @@
        </div>
    </div>
</div>
</div>
<tmpl_if name="is_admin">
<script type="text/javascript">
<!--
function custom_template_selected() {
    return ($('#template_master').val() == '0' ? true : false);
}
jQuery('#template_additional_list').find('li > a').click(function(e) {
    e.preventDefault();
    delAdditionalTemplate($(this).parent().attr('rel'));
});
jQuery('div.panel_client')
        .find('div.pnl_formsarea')
        .find('fieldset')
        .find('input,select,button')
        .not('#template_master,#template_additional,#default_mailserver,#default_webserver,#default_dbserver,#default_dnsserver,#default_slave_dnsserver')
        .click(function(e) {
            if(custom_template_selected()) return true;
            e.preventDefault();
            alert('{tmpl_var name="err_msg_master_tpl_set"}');
        })
        .focus(function() {
            if(custom_template_selected()) return true;
            $(this).blur();
        });
//-->
</script>
</tmpl_if>