From 02820e15a35ead7c2c42b7ca8a7b68b983a58169 Mon Sep 17 00:00:00 2001 From: ftimme Date: Thu, 26 Apr 2012 16:28:47 +0000 Subject: [PATCH] - Added expandable subsections to client, client template, and reseller limits. --- interface/web/client/client_template_edit.php | 194 +++++++++--------- interface/web/client/lib/lang/de_client.lng | 6 + .../client/lib/lang/de_client_template.lng | 6 + interface/web/client/lib/lang/de_reseller.lng | 6 + interface/web/client/lib/lang/en_client.lng | 6 + .../client/lib/lang/en_client_template.lng | 6 + interface/web/client/lib/lang/en_reseller.lng | 6 + .../client/templates/client_edit_limits.htm | 144 +++++++------ .../templates/client_template_edit_limits.htm | 124 ++++++----- .../client/templates/reseller_edit_limits.htm | 160 ++++++++------- 10 files changed, 374 insertions(+), 284 deletions(-) diff --git a/interface/web/client/client_template_edit.php b/interface/web/client/client_template_edit.php index d3f5c65cf..2de0e6300 100644 --- a/interface/web/client/client_template_edit.php +++ b/interface/web/client/client_template_edit.php @@ -1,97 +1,97 @@ -auth->check_module_permissions('client'); -if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.'); - -// Loading classes -$app->uses('tpl,tform,tform_actions'); -$app->load('tform_actions'); - -class page_action extends tform_actions { - - function onBeforeUpdate() { - global $app; - - if(isset($this->dataRecord['template_type'])) { - //* Check if the template_type has been changed - $rec = $app->db->queryOneRecord("SELECT template_type from client_template WHERE template_id = ".$this->id); - if($rec['template_type'] != $this->dataRecord['template_type']) { - //* Add a error message and switch back to old server - $app->tform->errorMessage .= $app->lng('The template type can not be changed.'); - $this->dataRecord['template_type'] = $rec['template_type']; - } - unset($rec); - } - } - - - /* - This function is called automatically right after - the data was successful updated in the database. - */ - function onAfterUpdate() { - global $app; - - /* - * the template has changed. apply the new data to all clients - */ - 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); - if (is_array($clients)){ - foreach ($clients as $client){ - applyClientTemplates($client['client_id']); - } - } - } -} - -$page = new page_action; -$page->onLoad(); -?> +auth->check_module_permissions('client'); +if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.'); + +// Loading classes +$app->uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + function onBeforeUpdate() { + global $app; + + if(isset($this->dataRecord['template_type'])) { + //* Check if the template_type has been changed + $rec = $app->db->queryOneRecord("SELECT template_type from client_template WHERE template_id = ".$this->id); + if($rec['template_type'] != $this->dataRecord['template_type']) { + //* Add a error message and switch back to old server + $app->tform->errorMessage .= $app->lng('The template type can not be changed.'); + $this->dataRecord['template_type'] = $rec['template_type']; + } + unset($rec); + } + } + + + /* + This function is called automatically right after + the data was successful updated in the database. + */ + function onAfterUpdate() { + global $app; + + /* + * the template has changed. apply the new data to all clients + */ + 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); + if (is_array($clients)){ + foreach ($clients as $client){ + applyClientTemplates($client['client_id']); + } + } + } +} + +$page = new page_action; +$page->onLoad(); +?> diff --git a/interface/web/client/lib/lang/de_client.lng b/interface/web/client/lib/lang/de_client.lng index 51ab88aa5..587d0d506 100644 --- a/interface/web/client/lib/lang/de_client.lng +++ b/interface/web/client/lib/lang/de_client.lng @@ -111,4 +111,10 @@ $wb['bank_code_txt'] = 'BLZ'; $wb['bank_name_txt'] = 'Bank'; $wb['bank_account_iban_txt'] = 'IBAN'; $wb['bank_account_swift_txt'] = 'BIC'; +$wb["web_limits_txt"] = 'Web-Limits'; +$wb["email_limits_txt"] = 'Email-Limits'; +$wb["database_limits_txt"] = 'Datenbank-Limits'; +$wb["cron_job_limits_txt"] = 'Cron Job-Limits'; +$wb["dns_limits_txt"] = 'DNS-Limits'; +$wb["virtualization_limits_txt"] = 'Virtualisierungs-Limits'; ?> diff --git a/interface/web/client/lib/lang/de_client_template.lng b/interface/web/client/lib/lang/de_client_template.lng index ea73ddab3..08e67f5e1 100644 --- a/interface/web/client/lib/lang/de_client_template.lng +++ b/interface/web/client/lib/lang/de_client_template.lng @@ -69,4 +69,10 @@ $wb['ssh_chroot_txt'] = 'SSH-Chroot Options'; $wb['web_php_options_txt'] = 'PHP Options'; $wb['template_type_txt'] = 'Template type'; $wb['template_name_txt'] = 'Template name'; +$wb["web_limits_txt"] = 'Web-Limits'; +$wb["email_limits_txt"] = 'Email-Limits'; +$wb["database_limits_txt"] = 'Datenbank-Limits'; +$wb["cron_job_limits_txt"] = 'Cron Job-Limits'; +$wb["dns_limits_txt"] = 'DNS-Limits'; +$wb["virtualization_limits_txt"] = 'Virtualisierungs-Limits'; ?> diff --git a/interface/web/client/lib/lang/de_reseller.lng b/interface/web/client/lib/lang/de_reseller.lng index 55dbfe0cb..b34bd1ccc 100644 --- a/interface/web/client/lib/lang/de_reseller.lng +++ b/interface/web/client/lib/lang/de_reseller.lng @@ -106,4 +106,10 @@ $wb['limit_openvz_vm_template_id_txt'] = 'Force virtual server template'; $wb['limit_openvz_vm_error_notint'] = 'The virtual server limit must be a number.'; $wb['web_php_options_notempty'] = 'No PHP option(s) selected. Select at least one PHP option.'; $wb['ssh_chroot_notempty'] = 'No SSH chroot option selected. Select at least one SSH option.'; +$wb["web_limits_txt"] = 'Web-Limits'; +$wb["email_limits_txt"] = 'Email-Limits'; +$wb["database_limits_txt"] = 'Datenbank-Limits'; +$wb["cron_job_limits_txt"] = 'Cron Job-Limits'; +$wb["dns_limits_txt"] = 'DNS-Limits'; +$wb["virtualization_limits_txt"] = 'Virtualisierungs-Limits'; ?> diff --git a/interface/web/client/lib/lang/en_client.lng b/interface/web/client/lib/lang/en_client.lng index 4981afa3f..d91274455 100644 --- a/interface/web/client/lib/lang/en_client.lng +++ b/interface/web/client/lib/lang/en_client.lng @@ -114,4 +114,10 @@ $wb["bank_code_txt"] = 'Bank code'; $wb["bank_name_txt"] = 'Bank name'; $wb["bank_account_iban_txt"] = 'IBAN'; $wb["bank_account_swift_txt"] = 'BIC / Swift'; +$wb["web_limits_txt"] = 'Web Limits'; +$wb["email_limits_txt"] = 'Email Limits'; +$wb["database_limits_txt"] = 'Database Limits'; +$wb["cron_job_limits_txt"] = 'Cron Job Limits'; +$wb["dns_limits_txt"] = 'DNS Limits'; +$wb["virtualization_limits_txt"] = 'Virtualization Limits'; ?> diff --git a/interface/web/client/lib/lang/en_client_template.lng b/interface/web/client/lib/lang/en_client_template.lng index d6f6a5633..c733a7179 100644 --- a/interface/web/client/lib/lang/en_client_template.lng +++ b/interface/web/client/lib/lang/en_client_template.lng @@ -70,4 +70,10 @@ $wb["limit_openvz_vm_template_id_txt"] = 'Force virtual server template'; $wb["limit_openvz_vm_error_notint"] = 'The virtual server limit must be a number.'; $wb["ssh_chroot_txt"] = 'SSH-Chroot Options'; $wb["web_php_options_txt"] = 'PHP Options'; +$wb["web_limits_txt"] = 'Web Limits'; +$wb["email_limits_txt"] = 'Email Limits'; +$wb["database_limits_txt"] = 'Database Limits'; +$wb["cron_job_limits_txt"] = 'Cron Job Limits'; +$wb["dns_limits_txt"] = 'DNS Limits'; +$wb["virtualization_limits_txt"] = 'Virtualization Limits'; ?> \ No newline at end of file diff --git a/interface/web/client/lib/lang/en_reseller.lng b/interface/web/client/lib/lang/en_reseller.lng index b93f54ee8..df2ec24ac 100644 --- a/interface/web/client/lib/lang/en_reseller.lng +++ b/interface/web/client/lib/lang/en_reseller.lng @@ -108,4 +108,10 @@ $wb["limit_openvz_vm_template_id_txt"] = 'Force virtual server template'; $wb["limit_openvz_vm_error_notint"] = 'The virtual server limit must be a number.'; $wb["web_php_options_notempty"] = 'No PHP option(s) selected. Select at least one PHP option.'; $wb["ssh_chroot_notempty"] = 'No SSH chroot option selected. Select at least one SSH option.'; +$wb["web_limits_txt"] = 'Web Limits'; +$wb["email_limits_txt"] = 'Email Limits'; +$wb["database_limits_txt"] = 'Database Limits'; +$wb["cron_job_limits_txt"] = 'Cron Job Limits'; +$wb["dns_limits_txt"] = 'DNS Limits'; +$wb["virtualization_limits_txt"] = 'Virtualization Limits'; ?> diff --git a/interface/web/client/templates/client_edit_limits.htm b/interface/web/client/templates/client_edit_limits.htm index 472fb877c..facff980a 100644 --- a/interface/web/client/templates/client_edit_limits.htm +++ b/interface/web/client/templates/client_edit_limits.htm @@ -35,6 +35,61 @@   +
{tmpl_var name='web_limits_txt'}
+
+
+ + +
+
+ + +
+
+ +  MB +
+
+ +  MB +
+
+

{tmpl_var name='web_php_options_txt'}

+
+ {tmpl_var name='web_php_options'} +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='ssh_chroot_txt'}

+
+ {tmpl_var name='ssh_chroot'} +
+
+
+ + +
+
+
{tmpl_var name='email_limits_txt'}
+
-
- - -
-
- - -
-
- -  MB -
-
-

{tmpl_var name='web_php_options_txt'}

-
- {tmpl_var name='web_php_options'} -
+
{tmpl_var name='database_limits_txt'}
+
- - + +
- - + +
-
- -
+
{tmpl_var name='cron_job_limits_txt'}
+
- - -
+ + +
-

{tmpl_var name='ssh_chroot_txt'}

-
- {tmpl_var name='ssh_chroot'} -
-
+ + +
- - + + +
+
{tmpl_var name='dns_limits_txt'}
+
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB
+
{tmpl_var name='virtualization_limits_txt'}
+
@@ -199,6 +216,7 @@ {tmpl_var name='limit_openvz_vm_template_id'}
+
diff --git a/interface/web/client/templates/client_template_edit_limits.htm b/interface/web/client/templates/client_template_edit_limits.htm index ac62a7c6f..808d5558b 100644 --- a/interface/web/client/templates/client_template_edit_limits.htm +++ b/interface/web/client/templates/client_template_edit_limits.htm @@ -5,6 +5,55 @@
Limits +
{tmpl_var name='web_limits_txt'}
+
+
+ + +
+
+ +  MB +
+
+ +  MB +
+
+

{tmpl_var name='web_php_options_txt'}

+
+ {tmpl_var name='web_php_options'} +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='ssh_chroot_txt'}

+
+ {tmpl_var name='ssh_chroot'} +
+
+
+ + +
+
+
{tmpl_var name='email_limits_txt'}
+
@@ -61,62 +110,16 @@
-
- - -
-
- -  MB -
-
-

{tmpl_var name='web_php_options_txt'}

-
- {tmpl_var name='web_php_options'} -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-

{tmpl_var name='ssh_chroot_txt'}

-
- {tmpl_var name='ssh_chroot'} -
-
-
- - -
-
- - -
-
- - -
-
- -
+
{tmpl_var name='database_limits_txt'}
+
+
+
{tmpl_var name='cron_job_limits_txt'}
+
@@ -131,10 +134,24 @@
+
+
{tmpl_var name='dns_limits_txt'}
+
- -  MB + + +
+
+ +
+
+ + +
+
+
{tmpl_var name='virtualization_limits_txt'}
+
@@ -145,6 +162,7 @@ {tmpl_var name='limit_openvz_vm_template_id'}
+
diff --git a/interface/web/client/templates/reseller_edit_limits.htm b/interface/web/client/templates/reseller_edit_limits.htm index f6ead6051..118b8b89d 100644 --- a/interface/web/client/templates/reseller_edit_limits.htm +++ b/interface/web/client/templates/reseller_edit_limits.htm @@ -26,7 +26,66 @@
--> +
+ + +
+
{tmpl_var name='web_limits_txt'}
+
+
+ + +
+
+ + +
+
+ +  MB +
+
+ +  MB +
+
+

{tmpl_var name='web_php_options_txt'}

+
+ {tmpl_var name='web_php_options'} +
+
+
+ + +
+
+ + +
+ + +
+
+ + +
+
+

{tmpl_var name='ssh_chroot_txt'}

+
+ {tmpl_var name='ssh_chroot'} +
+
+
+ + +
+
+
{tmpl_var name='email_limits_txt'}
+
+
+
+
{tmpl_var name='database_limits_txt'}
+
- - + {tmpl_var name='default_dbserver'}
- - -
-
- -  MB -
-
-

{tmpl_var name='web_php_options_txt'}

-
- {tmpl_var name='web_php_options'} -
-
-
- - -
-
- - -
-
- - + +
+
+
{tmpl_var name='cron_job_limits_txt'}
+
- - -
+ + +
-

{tmpl_var name='ssh_chroot_txt'}

-
- {tmpl_var name='ssh_chroot'} -
-
-
- - -
+ + +
+ + +
+ +
{tmpl_var name='dns_limits_txt'}
+
+
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -  MB -
+
+
{tmpl_var name='virtualization_limits_txt'}
+
@@ -194,6 +211,7 @@ {tmpl_var name='limit_openvz_vm_template_id'}
+
-- GitLab