Commit 554c4035 authored by Till Brehm's avatar Till Brehm
Browse files

- Added option to allow resellers to add domains in the domain limits (domain module).

- Added section toggle for client limits
parent 94c9617e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
ALTER TABLE `client` ADD `limit_domainmodule` INT NOT NULL DEFAULT '0';
ALTER TABLE `client_template` ADD `limit_domainmodule` INT NOT NULL DEFAULT '0';
+2 −0
Original line number Diff line number Diff line
@@ -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',
+2 −1
Original line number Diff line number Diff line
@@ -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();
+9 −0
Original line number Diff line number Diff line
@@ -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() {
+14 −0
Original line number Diff line number Diff line
@@ -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
		//#################################
Loading