From 7ce09d1bda9fa57e97c967fb5f0c242357ba858b Mon Sep 17 00:00:00 2001 From: vogelor Date: Mon, 15 Dec 2008 22:00:12 +0000 Subject: [PATCH] Added Client Templates (only the list itself) --- interface/web/client/client_template_edit.php | 59 +++ interface/web/client/client_template_list.php | 22 + .../web/client/form/client_template.tform.php | 404 ++++++++++++++++++ .../client/lib/lang/en_client_template.lng | 52 +++ .../lib/lang/en_client_template_list.lng | 5 + interface/web/client/lib/module.conf.php | 5 + .../web/client/list/client_template.list.php | 65 +++ .../templates/client_template_edit_limits.htm | 101 +++++ .../client_template_edit_template.htm | 25 ++ .../client/templates/client_template_list.htm | 52 +++ 10 files changed, 790 insertions(+) create mode 100644 interface/web/client/client_template_edit.php create mode 100644 interface/web/client/client_template_list.php create mode 100644 interface/web/client/form/client_template.tform.php create mode 100644 interface/web/client/lib/lang/en_client_template.lng create mode 100644 interface/web/client/lib/lang/en_client_template_list.lng create mode 100644 interface/web/client/list/client_template.list.php create mode 100644 interface/web/client/templates/client_template_edit_limits.htm create mode 100644 interface/web/client/templates/client_template_edit_template.htm create mode 100644 interface/web/client/templates/client_template_list.htm diff --git a/interface/web/client/client_template_edit.php b/interface/web/client/client_template_edit.php new file mode 100644 index 000000000..8a0705e0d --- /dev/null +++ b/interface/web/client/client_template_edit.php @@ -0,0 +1,59 @@ +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 { + +} + +$page = new page_action; +$page->onLoad(); +?> diff --git a/interface/web/client/client_template_list.php b/interface/web/client/client_template_list.php new file mode 100644 index 000000000..85e3ee2b2 --- /dev/null +++ b/interface/web/client/client_template_list.php @@ -0,0 +1,22 @@ +auth->check_module_permissions('client'); + +if(!$_SESSION["s"]["user"]["typ"] == 'admin') die('Client-Templates are only for Admins.'); + +$app->uses('listform_actions'); +$app->listform_actions->onLoad(); +?> diff --git a/interface/web/client/form/client_template.tform.php b/interface/web/client/form/client_template.tform.php new file mode 100644 index 000000000..59be8049f --- /dev/null +++ b/interface/web/client/form/client_template.tform.php @@ -0,0 +1,404 @@ + 0 id must match with id of current user +$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user +$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete +$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete + +//* Languages +$language_list = array(); +$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang'); +while ($file = @readdir ($handle)) { + if ($file != '.' && $file != '..') { + if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') { + $tmp = substr($file, 0, 2); + $language_list[$tmp] = $tmp; + } + } +} + +$form["tabs"]['template'] = array ( + 'title' => "Template", + 'width' => 80, + 'template' => "templates/client_template_edit_template.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'template_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'm', + 'value' => array('m' => "Main Template",'a' => "Additional Template"), + ), + 'template_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'error_template_name_empty'), + ), + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +$form["tabs"]['limits'] = array ( + 'title' => "Limits", + 'width' => 80, + 'template' => "templates/client_template_edit_limits.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'limit_maildomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_maildomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailbox' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailbox_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailalias' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailalias_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailforward' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailforward_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailcatchall' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailcatchall_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailrouting' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailrouting_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailfilter' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfilter_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_fetchmail' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailfetchmail_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_mailquota' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_mailquota_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_wblist' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_wblist_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_spamfilter_policy' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_spamfilter_policy_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_domain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_domain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_aliasdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_aliasdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_web_subdomain' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_web_subdomain_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_ftp_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_ftp_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_shell_user' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_shell_user_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_zone' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_zone_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_dns_record' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_dns_record_error_notint'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_client' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_client_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_database' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_database_error_notint'), + ), + 'default' => '-1', + '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 new file mode 100644 index 000000000..46765b68a --- /dev/null +++ b/interface/web/client/lib/lang/en_client_template.lng @@ -0,0 +1,52 @@ + \ 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 new file mode 100644 index 000000000..ac5218686 --- /dev/null +++ b/interface/web/client/lib/lang/en_client_template_list.lng @@ -0,0 +1,5 @@ + diff --git a/interface/web/client/lib/module.conf.php b/interface/web/client/lib/module.conf.php index 23c4a18b8..4d9a0cea2 100644 --- a/interface/web/client/lib/module.conf.php +++ b/interface/web/client/lib/module.conf.php @@ -19,6 +19,11 @@ $items[] = array( 'title' => "Edit Client", 'target' => 'content', 'link' => 'client/client_list.php'); +if($_SESSION["s"]["user"]["typ"] == 'admin'){ + $items[] = array( 'title' => "Edit Client-Templates", + 'target' => 'content', + 'link' => 'client/client_template_list.php'); +} $module["nav"][] = array( 'title' => 'Clients', 'open' => 1, diff --git a/interface/web/client/list/client_template.list.php b/interface/web/client/list/client_template.list.php new file mode 100644 index 000000000..3cdf6b87d --- /dev/null +++ b/interface/web/client/list/client_template.list.php @@ -0,0 +1,65 @@ + "template_type", + 'datatype' => "VARCHAR", + 'formtype' => "SELECT", + 'op' => "=", + 'prefix' => "", + 'suffix' => "", + 'width' => "", + 'value' => array('m' => "Main Template",'a' => "Additional Template")); + +$liste["item"][] = array( 'field' => "template_name", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); +?> diff --git a/interface/web/client/templates/client_template_edit_limits.htm b/interface/web/client/templates/client_template_edit_limits.htm new file mode 100644 index 000000000..57d1035f5 --- /dev/null +++ b/interface/web/client/templates/client_template_edit_limits.htm @@ -0,0 +1,101 @@ +

+ +
+ +
+
Limits + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +
+
+ +
diff --git a/interface/web/client/templates/client_template_edit_template.htm b/interface/web/client/templates/client_template_edit_template.htm new file mode 100644 index 000000000..12bafecb7 --- /dev/null +++ b/interface/web/client/templates/client_template_edit_template.htm @@ -0,0 +1,25 @@ +

+ +
+ +
+
Template + + + + + + + *
+
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/client/templates/client_template_list.htm b/interface/web/client/templates/client_template_list.htm new file mode 100644 index 000000000..81e5e74f8 --- /dev/null +++ b/interface/web/client/templates/client_template_list.htm @@ -0,0 +1,52 @@ +

+ +
+ +
+
Tools +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="template_type"}{tmpl_var name="template_name"} + +
+
+
+ +
\ No newline at end of file -- GitLab