diff --git a/install/sql/incremental/upd_0063.sql b/install/sql/incremental/upd_0063.sql new file mode 100644 index 0000000000000000000000000000000000000000..6c094662bd3f3a4fd7cd8fabcd4a7ef316e3d8f7 --- /dev/null +++ b/install/sql/incremental/upd_0063.sql @@ -0,0 +1,2 @@ +ALTER TABLE `client` ADD `limit_domainmodule` INT NOT NULL DEFAULT '0'; +ALTER TABLE `client_template` ADD `limit_domainmodule` INT NOT NULL DEFAULT '0'; diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql index 783a5cdb87146e56aead3f50bc04a42f5f641450..600b853dcc16c9d7377df8c525b4671ed2486ef3 100644 --- a/install/sql/ispconfig3.sql +++ b/install/sql/ispconfig3.sql @@ -215,6 +215,7 @@ CREATE TABLE `client` ( `limit_cron_frequency` int(11) NOT NULL DEFAULT '5', `limit_traffic_quota` int(11) NOT NULL DEFAULT '-1', `limit_client` int(11) NOT NULL DEFAULT '0', + `limit_domainmodule` int(11) NOT NULL DEFAULT '0', `limit_mailmailinglist` int(11) NOT NULL DEFAULT '-1', `limit_openvz_vm` int(11) NOT NULL DEFAULT '0', `limit_openvz_vm_template_id` int(11) NOT NULL DEFAULT '0', @@ -317,6 +318,7 @@ CREATE TABLE `client_template` ( `limit_cron_frequency` int(11) NOT NULL default '5', `limit_traffic_quota` int(11) NOT NULL default '-1', `limit_client` int(11) NOT NULL default '0', + `limit_domainmodule` int(11) NOT NULL DEFAULT '0', `limit_mailmailinglist` int(11) NOT NULL default '-1', `limit_openvz_vm` int(11) NOT NULL DEFAULT '0', `limit_openvz_vm_template_id` int(11) NOT NULL DEFAULT '0', diff --git a/interface/web/client/client_template_edit.php b/interface/web/client/client_template_edit.php index 5a379ee657b56f0d5b4b9c138d194dfde5774132..bc5c6d22cf3fb77f502901e125b112756d3d89d2 100644 --- a/interface/web/client/client_template_edit.php +++ b/interface/web/client/client_template_edit.php @@ -55,9 +55,10 @@ class page_action extends tform_actions { function onSubmit() { global $app; - //* Resellers shall not be able to create another reseller + //* Resellers shall not be able to create another reseller or set reseller specific settings if($_SESSION["s"]["user"]["typ"] == 'user') { $this->dataRecord['limit_client'] = 0; + $this->dataRecord['limit_domainmodule'] = 0; } parent::onSubmit(); diff --git a/interface/web/client/domain_edit.php b/interface/web/client/domain_edit.php index 24a4c81515ece409e4d39fd47ffdd449eb6ee2b4..07929f901eeb71a3a8da033f2f4a9f34f33bd1c0 100644 --- a/interface/web/client/domain_edit.php +++ b/interface/web/client/domain_edit.php @@ -52,6 +52,15 @@ $app->load('tform_actions'); $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'.lng'; include $lng_file; +if(!$app->tform->checkClientLimit('limit_domainmodule')) { + $app->uses('ini_parser,getconf'); + $settings = $app->getconf->get_global_config('domains'); + if ($settings['use_domain_module'] == 'y') { + $app->error($settings['new_domain_html']); + } +} + + class page_action extends tform_actions { function onShowNew() { diff --git a/interface/web/client/form/reseller.tform.php b/interface/web/client/form/reseller.tform.php index 77e1f63a6ad4eac098368e4b2af7ac6a79d4397e..a37210990618db097a2ce27d9a7c4ae6ea1d6fa6 100644 --- a/interface/web/client/form/reseller.tform.php +++ b/interface/web/client/form/reseller.tform.php @@ -1130,6 +1130,20 @@ $form["tabs"]['limits'] = array ( 'width' => '30', 'maxlength' => '255' ), + 'limit_domainmodule' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_domainmodule_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), //################################# // END Datatable fields //################################# diff --git a/interface/web/client/lib/lang/en_client_template.lng b/interface/web/client/lib/lang/en_client_template.lng index e7c06a8b6ffa25999e68e764d431b0d4095b0cfb..0eef4700bf0bb88c39a12d7b072debb9d418d0ee 100644 --- a/interface/web/client/lib/lang/en_client_template.lng +++ b/interface/web/client/lib/lang/en_client_template.lng @@ -88,4 +88,6 @@ $wb["virtualization_limits_txt"] = 'Virtualization Limits'; $wb['aps_limits_txt'] = 'APS Installer Limits'; $wb['limit_aps_txt'] = 'Max. number of APS instances'; $wb['limit_aps_error_notint'] = 'The APS instances limit must be a number.'; +$wb['limit_domainmodule_txt'] = 'Domainmodule Limit'; +$wb['client_limits_txt'] = 'Client Limits' ?> \ No newline at end of file diff --git a/interface/web/client/lib/lang/en_client_template_list.lng b/interface/web/client/lib/lang/en_client_template_list.lng index ce1f9bd123146ae3420c2280a9fe6dc5eba65d9f..1906cefc469e063b01a1ea409cb7fe311f964977 100644 --- a/interface/web/client/lib/lang/en_client_template_list.lng +++ b/interface/web/client/lib/lang/en_client_template_list.lng @@ -1,5 +1,5 @@ diff --git a/interface/web/client/lib/module.conf.php b/interface/web/client/lib/module.conf.php index 92775ea139f482b1b7cc0b63e8f42dcbbb9183d0..8b97848b3a5e50eccc259e9387b6ba243cf0b857 100644 --- a/interface/web/client/lib/module.conf.php +++ b/interface/web/client/lib/module.conf.php @@ -17,13 +17,6 @@ $items[] = array( 'title' => "Add Client", 'link' => 'client/client_edit.php', 'html_id' => 'client_add'); -if($_SESSION["s"]["user"]["typ"] == 'admin'){ - $items[] = array( 'title' => "Edit Client-Templates", - 'target' => 'content', - 'link' => 'client/client_template_list.php', - 'html_id' => 'client_template_list'); -} - $module["nav"][] = array( 'title' => 'Clients', 'open' => 1, 'items' => $items); @@ -66,11 +59,11 @@ $module["nav"][] = array( 'title' => 'Messaging', 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'); + +$items[] = array( 'title' => "Limit-Templates", + 'target' => 'content', + 'link' => 'client/client_template_list.php', + 'html_id' => 'client_template_list'); $module["nav"][] = array( 'title' => 'Templates', @@ -78,7 +71,6 @@ $module["nav"][] = array( 'title' => 'Templates', 'items' => $items); unset($items); -//} $app->uses('ini_parser,getconf'); diff --git a/interface/web/client/templates/client_edit_limits.htm b/interface/web/client/templates/client_edit_limits.htm index 49be46bd00035a466b68e6174682c406f43d867b..fa2bbb7326621b07ecabcbcdcfb900714d4674e5 100644 --- a/interface/web/client/templates/client_edit_limits.htm +++ b/interface/web/client/templates/client_edit_limits.htm @@ -313,7 +313,7 @@ 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') + .not('#template_master,#template_additional,#default_mailserver,#default_webserver,#default_dbserver,#default_dnsserver,#default_slave_dnsserver,#customer_no_template,#customer_no_start,#customer_no_counter') .click(function(e) { if(custom_template_selected()) return true; e.preventDefault(); diff --git a/interface/web/client/templates/client_template_edit_limits.htm b/interface/web/client/templates/client_template_edit_limits.htm index 5f1e37b2b1a0d7ef372eeef364c4ab1be2694b1d..1eea39900407dba216fc2f6761236cbd7012316a 100644 --- a/interface/web/client/templates/client_template_edit_limits.htm +++ b/interface/web/client/templates/client_template_edit_limits.htm @@ -5,12 +5,6 @@