diff --git a/interface/lib/classes/custom_datasource.inc.php b/interface/lib/classes/custom_datasource.inc.php index d89991f975c71c25a1f1fd382398c5af17cdaca6..52cd8b775a680d0e25e3ff11659b54bb6174716a 100644 --- a/interface/lib/classes/custom_datasource.inc.php +++ b/interface/lib/classes/custom_datasource.inc.php @@ -64,6 +64,32 @@ class custom_datasource { } + function client_servers($field, $record) { + global $app, $conf; + + $server_type = $field['name']; + + if($_SESSION["s"]["user"]["typ"] == 'user') { + // Get the limits of the client + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $sql = "SELECT $server_type as server_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"; + $client = $app->db->queryOneRecord($sql); + $sql = "SELECT server_id,server_name FROM server WHERE server_id = ".$client['server_id']; + } else { + $sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name"; + } + $records = $app->db->queryAllRecords($sql); + $records_new = array(); + if(is_array($records)) { + foreach($records as $rec) { + $key = $rec['server_id']; + $records_new[$key] = $rec['server_name']; + } + } + return $records_new; + } + + } diff --git a/interface/lib/classes/validate_reseller.inc.php b/interface/lib/classes/validate_reseller.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..54539050282bd5b5306ec65123d82f1fe6b2748b --- /dev/null +++ b/interface/lib/classes/validate_reseller.inc.php @@ -0,0 +1,47 @@ +tform->lng('limit_client_error_positive'); + } else { + return ''; + } + } + + +} \ No newline at end of file diff --git a/interface/web/admin/form/server.tform.php b/interface/web/admin/form/server.tform.php index 80b672ef1e7e5e1665244818c1fdb001c384a0c0..87b1c18cda10b9609579d743c1a3c9f9f212e93b 100644 --- a/interface/web/admin/form/server.tform.php +++ b/interface/web/admin/form/server.tform.php @@ -122,7 +122,7 @@ $form["tabs"]['services'] = array ( ) ); - +/* $form["tabs"]['config'] = array ( 'title' => "Config", 'width' => 100, @@ -146,6 +146,6 @@ $form["tabs"]['config'] = array ( ################################## ) ); - +*/ ?> \ No newline at end of file diff --git a/interface/web/admin/templates/server_config_list.htm b/interface/web/admin/templates/server_config_list.htm index d6584b6a0c6f4738d6f9bb74d25f757c813bcbc1..f635cad7ea8728b357cb242b0d968f25beabe2fb 100644 --- a/interface/web/admin/templates/server_config_list.htm +++ b/interface/web/admin/templates/server_config_list.htm @@ -1,50 +1,40 @@ -

-

- -
- -
-
Tools -
- -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
 
{tmpl_var name="server_name"} - -
-
-
- -
+

+

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="server_name"} + +
+
+
+ +
diff --git a/interface/web/admin/templates/server_list.htm b/interface/web/admin/templates/server_list.htm index b0ca2628a5d97763b7a33094b7413e5eef01216a..7163843faf3ecfbc7374304ec26a3a0dca296478 100644 --- a/interface/web/admin/templates/server_list.htm +++ b/interface/web/admin/templates/server_list.htm @@ -1,68 +1,58 @@ -

-

- -
- -
-
Tools -
- -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
{tmpl_var name="server_name"}{tmpl_var name="mail_server"}{tmpl_var name="web_server"}{tmpl_var name="dns_server"}{tmpl_var name="file_server"}{tmpl_var name="db_server"}{tmpl_var name="vserver_server"} - -
-
-
- -
+

+

+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="server_name"}{tmpl_var name="mail_server"}{tmpl_var name="web_server"}{tmpl_var name="dns_server"}{tmpl_var name="file_server"}{tmpl_var name="db_server"}{tmpl_var name="vserver_server"} + +
+
+
+ +
diff --git a/interface/web/client/client_list.php b/interface/web/client/client_list.php index 84eb799d0f51a629a7ed760b36ee78c98c1ad93c..590da21d752997d8ca476e1da1e4c1cc391aae2c 100644 --- a/interface/web/client/client_list.php +++ b/interface/web/client/client_list.php @@ -18,6 +18,7 @@ $app->auth->check_module_permissions('client'); $app->uses('listform_actions'); $app->listform_actions->SQLOrderBy = 'ORDER BY company_name, contact_name, client_id'; +$app->listform_actions->SQLExtWhere = "limit_client = 0"; $app->listform_actions->onLoad(); diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php index 4cc9dd57e6b59f8e2b520e9a115f6ccef4d0c2b8..323a5f4a314e13433ee3cc34726ed93d97148a8e 100644 --- a/interface/web/client/form/client.tform.php +++ b/interface/web/client/form/client.tform.php @@ -1,730 +1,730 @@ - 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"]['address'] = array ( - 'title' => "Address", - 'width' => 100, - 'template' => "templates/client_edit_address.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'company_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'contact_name' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'contact_error_empty'), - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'username' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', - 'errmsg'=> 'username_error_empty'), - 1 => array ( 'type' => 'CUSTOM', - 'class' => 'validate_client', - 'function' => 'username_unique', - 'errmsg'=> 'username_error_unique'), - 2 => array ( 'type' => 'REGEX', - 'regex' => '/^[\w\.\-\_]{0,64}$/', - 'errmsg'=> 'username_error_regex'), - ), - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'password' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'PASSWORD', - 'encryption'=> 'CRYPT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'language' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => $conf["language"], - 'value' => $language_list, - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'usertheme' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => 'default', - 'value' => array('default' => 'default'), - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'street' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'zip' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'city' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'state' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'country' => array ( - 'datatype' => 'VARCHAR', - - 'formtype' => 'SELECT', - 'default' => 'DE', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', - 'keyfield'=> 'iso', - 'valuefield'=> 'printable_name' - ), - 'value' => '' - ), - 'telephone' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'mobile' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'fax' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'email' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'internet' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => 'http://', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'icq' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '30', - 'maxlength' => '255', - 'rows' => '', - 'cols' => '' - ), - 'notes' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'TEXTAREA', - 'default' => '', - 'value' => '', - 'separator' => '', - 'width' => '', - 'maxlength' => '', - 'rows' => '10', - 'cols' => '30' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -$form["tabs"]['limits'] = array ( - 'title' => "Limits", - 'width' => 80, - 'template' => "templates/client_edit_limits.htm", - 'fields' => array ( - ################################## - # Begin Datatable fields - ################################## - 'template_master' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'CUSTOM', - 'class'=> 'custom_datasource', - 'function'=> 'master_templates' - ), - 'value' => '' - ), - 'template_additional' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'TEXT', - ), - 'default_mailserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - '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' => '' - ), - 'default_webserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE web_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - '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' => '' - ), - 'web_php_options' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'separator' => ',', - 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') - ), - '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' => '' - ), - 'ssh_chroot' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'separator' => ',', - 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') - ), - 'default_dnsserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE dns_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - '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' => '' - ), - 'default_dbserver' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'SELECT', - 'default' => '1', - 'datasource' => array ( 'type' => 'SQL', - 'querystring' => 'SELECT server_id,server_name FROM server WHERE db_server = 1 AND {AUTHSQL} ORDER BY server_name', - 'keyfield'=> 'server_id', - 'valuefield'=> 'server_name' - ), - 'value' => '' - ), - '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' => '' - ), - 'limit_cron' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_cron_error_notint'), - ), - 'default' => '0', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - 'limit_cron_type' => array ( - 'datatype' => 'VARCHAR', - 'formtype' => 'SELECT', - 'default' => '', - 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') - ), - 'limit_cron_frequency' => array ( - 'datatype' => 'INTEGER', - 'formtype' => 'TEXT', - 'validators' => array ( 0 => array ( 'type' => 'ISINT', - 'errmsg'=> 'limit_cron_error_frequency'), - ), - 'default' => '-1', - 'value' => '', - 'separator' => '', - 'width' => '10', - 'maxlength' => '10', - 'rows' => '', - 'cols' => '' - ), - ################################## - # END Datatable fields - ################################## - ) -); - -/* -$form["tabs"]['ipaddress'] = array ( - 'title' => "IP Addresses", - 'width' => 100, - 'template' => "templates/client_edit_ipaddress.htm", - 'fields' => array ( - ################################## - # Beginn Datatable fields - ################################## - 'ip_address' => array ( - 'datatype' => 'TEXT', - 'formtype' => 'CHECKBOXARRAY', - 'default' => '', - 'value' => array('192.168.0.1' => '192.168.0.1', '192.168.0.2' => '192.168.0.2'), - 'separator' => ';' - ), - ################################## - # ENDE Datatable fields - ################################## - ) -); -*/ - - + 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"]['address'] = array ( + 'title' => "Address", + 'width' => 100, + 'template' => "templates/client_edit_address.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'company_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'contact_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'contact_error_empty'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'username' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'username_error_empty'), + 1 => array ( 'type' => 'CUSTOM', + 'class' => 'validate_client', + 'function' => 'username_unique', + 'errmsg'=> 'username_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-\_]{0,64}$/', + 'errmsg'=> 'username_error_regex'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'password' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption'=> 'CRYPT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'language' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => $conf["language"], + 'value' => $language_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'usertheme' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'default', + 'value' => array('default' => 'default'), + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'street' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'zip' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'city' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'state' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'country' => array ( + 'datatype' => 'VARCHAR', + + 'formtype' => 'SELECT', + 'default' => 'DE', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', + 'keyfield'=> 'iso', + 'valuefield'=> 'printable_name' + ), + 'value' => '' + ), + 'telephone' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'mobile' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'fax' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'email' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'internet' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => 'http://', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'icq' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'notes' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'TEXTAREA', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '', + 'maxlength' => '', + 'rows' => '10', + 'cols' => '30' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +$form["tabs"]['limits'] = array ( + 'title' => "Limits", + 'width' => 80, + 'template' => "templates/client_edit_limits.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'template_master' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'master_templates' + ), + 'value' => '' + ), + 'template_additional' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + ), + 'default_mailserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' + ), + 'value' => '', + 'name' => 'default_mailserver' + ), + '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' => '' + ), + 'default_webserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' + ), + 'value' => '', + 'name' => 'default_webserver' + ), + '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' => '' + ), + 'web_php_options' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') + ), + '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' => '' + ), + 'ssh_chroot' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') + ), + 'default_dnsserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' + ), + 'value' => '', + 'name' => 'default_dnsserver' + ), + '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' => '' + ), + 'default_dbserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'client_servers' + ), + 'value' => '', + 'name' => 'default_dbserver' + ), + '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' => '' + ), + 'limit_cron' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '', + 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') + ), + 'limit_cron_frequency' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_frequency'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +/* +$form["tabs"]['ipaddress'] = array ( + 'title' => "IP Addresses", + 'width' => 100, + 'template' => "templates/client_edit_ipaddress.htm", + 'fields' => array ( + ################################## + # Beginn Datatable fields + ################################## + 'ip_address' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'value' => array('192.168.0.1' => '192.168.0.1', '192.168.0.2' => '192.168.0.2'), + 'separator' => ';' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); +*/ + + ?> \ No newline at end of file diff --git a/interface/web/client/form/reseller.tform.php b/interface/web/client/form/reseller.tform.php new file mode 100644 index 0000000000000000000000000000000000000000..d069e00ef8e99ec45784957ea4bd118c1134419d --- /dev/null +++ b/interface/web/client/form/reseller.tform.php @@ -0,0 +1,733 @@ + 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"]['address'] = array ( + 'title' => "Address", + 'width' => 100, + 'template' => "templates/reseller_edit_address.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'company_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'contact_name' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'contact_error_empty'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'username' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', + 'errmsg'=> 'username_error_empty'), + 1 => array ( 'type' => 'CUSTOM', + 'class' => 'validate_client', + 'function' => 'username_unique', + 'errmsg'=> 'username_error_unique'), + 2 => array ( 'type' => 'REGEX', + 'regex' => '/^[\w\.\-\_]{0,64}$/', + 'errmsg'=> 'username_error_regex'), + ), + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'password' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'PASSWORD', + 'encryption'=> 'CRYPT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'language' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => $conf["language"], + 'value' => $language_list, + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'usertheme' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => 'default', + 'value' => array('default' => 'default'), + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'street' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'zip' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'city' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'state' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'country' => array ( + 'datatype' => 'VARCHAR', + + 'formtype' => 'SELECT', + 'default' => 'DE', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name', + 'keyfield'=> 'iso', + 'valuefield'=> 'printable_name' + ), + 'value' => '' + ), + 'telephone' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'mobile' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'fax' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'email' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'internet' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => 'http://', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'icq' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '30', + 'maxlength' => '255', + 'rows' => '', + 'cols' => '' + ), + 'notes' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'TEXTAREA', + 'default' => '', + 'value' => '', + 'separator' => '', + 'width' => '', + 'maxlength' => '', + 'rows' => '10', + 'cols' => '30' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +$form["tabs"]['limits'] = array ( + 'title' => "Limits", + 'width' => 80, + 'template' => "templates/reseller_edit_limits.htm", + 'fields' => array ( + ################################## + # Begin Datatable fields + ################################## + 'template_master' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'CUSTOM', + 'class'=> 'custom_datasource', + 'function'=> 'master_templates' + ), + 'value' => '' + ), + 'template_additional' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + ), + 'default_mailserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + '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' => '' + ), + 'default_webserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE web_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + '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' => '' + ), + 'web_php_options' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'value' => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP') + ), + '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' => '' + ), + 'ssh_chroot' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'separator' => ',', + 'value' => array('no' => 'None', 'jailkit' => 'Jailkit') + ), + 'default_dnsserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE dns_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + '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'), + 1 => array ( 'type' => 'CUSTOM', + 'class' => 'validate_reseller', + 'function' => 'limit_client'), + ), + 'default' => '1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'default_dbserver' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'SELECT', + 'default' => '1', + 'datasource' => array ( 'type' => 'SQL', + 'querystring' => 'SELECT server_id,server_name FROM server WHERE db_server = 1 AND {AUTHSQL} ORDER BY server_name', + 'keyfield'=> 'server_id', + 'valuefield'=> 'server_name' + ), + 'value' => '' + ), + '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' => '' + ), + 'limit_cron' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_notint'), + ), + 'default' => '0', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + 'limit_cron_type' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '', + 'value' => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron') + ), + 'limit_cron_frequency' => array ( + 'datatype' => 'INTEGER', + 'formtype' => 'TEXT', + 'validators' => array ( 0 => array ( 'type' => 'ISINT', + 'errmsg'=> 'limit_cron_error_frequency'), + ), + 'default' => '-1', + 'value' => '', + 'separator' => '', + 'width' => '10', + 'maxlength' => '10', + 'rows' => '', + 'cols' => '' + ), + ################################## + # END Datatable fields + ################################## + ) +); + +/* +$form["tabs"]['ipaddress'] = array ( + 'title' => "IP Addresses", + 'width' => 100, + 'template' => "templates/client_edit_ipaddress.htm", + 'fields' => array ( + ################################## + # Beginn Datatable fields + ################################## + 'ip_address' => array ( + 'datatype' => 'TEXT', + 'formtype' => 'CHECKBOXARRAY', + 'default' => '', + 'value' => array('192.168.0.1' => '192.168.0.1', '192.168.0.2' => '192.168.0.2'), + 'separator' => ';' + ), + ################################## + # ENDE Datatable fields + ################################## + ) +); +*/ + + +?> \ No newline at end of file diff --git a/interface/web/client/lib/lang/en.lng b/interface/web/client/lib/lang/en.lng index af8ccc2d6ac488018a83805627b006ffd01dfd7b..e384def35114ba47ba48f8760c2b3c7d37e51fbe 100644 --- a/interface/web/client/lib/lang/en.lng +++ b/interface/web/client/lib/lang/en.lng @@ -6,4 +6,7 @@ $wb['Add Client'] = 'Add Client'; $wb['Edit Client'] = 'Edit Client'; $wb['Clients'] = 'Clients'; $wb['Edit Client-Templates'] = 'Edit Client-Templates'; +$wb['Add Reseller'] = 'Add Reseller'; +$wb['Edit Reseller'] = 'Edit Reseller'; +$wb['Resellers'] = 'Resellers'; ?> \ 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 new file mode 100644 index 0000000000000000000000000000000000000000..906fd44bcbf6afea2d4ca47692cf513d4630537f --- /dev/null +++ b/interface/web/client/lib/lang/en_reseller.lng @@ -0,0 +1,93 @@ + 0'; +?> diff --git a/interface/web/client/lib/lang/en_resellers_list.lng b/interface/web/client/lib/lang/en_resellers_list.lng new file mode 100644 index 0000000000000000000000000000000000000000..523a467c58c5578c65492edc1a313fc0aa612369 --- /dev/null +++ b/interface/web/client/lib/lang/en_resellers_list.lng @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/interface/web/client/lib/module.conf.php b/interface/web/client/lib/module.conf.php index 4d9a0cea2c4698fd10a9b42f84d888d4e5a11779..cc4347b8711a816b09d3b92eb1157d9827c3143b 100644 --- a/interface/web/client/lib/module.conf.php +++ b/interface/web/client/lib/module.conf.php @@ -28,4 +28,36 @@ if($_SESSION["s"]["user"]["typ"] == 'admin'){ $module["nav"][] = array( 'title' => 'Clients', 'open' => 1, 'items' => $items); + +unset($items); + + +if($_SESSION["s"]["user"]["typ"] == 'admin'){ + +$items[] = array( 'title' => "Add Reseller", + 'target' => 'content', + 'link' => 'client/reseller_edit.php'); + +$items[] = array( 'title' => "Edit Reseller", + 'target' => 'content', + 'link' => 'client/reseller_list.php'); + +$module["nav"][] = array( 'title' => 'Resellers', + 'open' => 1, + 'items' => $items); +} + + + + + + + + + + + + + + ?> \ No newline at end of file diff --git a/interface/web/client/list/reseller.list.php b/interface/web/client/list/reseller.list.php new file mode 100644 index 0000000000000000000000000000000000000000..39b8ecc87d6b131a17ec3bd7aea248f9f0134b01 --- /dev/null +++ b/interface/web/client/list/reseller.list.php @@ -0,0 +1,87 @@ + "company_name", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "contact_name", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "city", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + +$liste["item"][] = array( 'field' => "country", + 'datatype' => "VARCHAR", + 'formtype' => "TEXT", + 'op' => "like", + 'prefix' => "%", + 'suffix' => "%", + 'width' => "", + 'value' => ""); + + +?> \ No newline at end of file diff --git a/interface/web/client/reseller_del.php b/interface/web/client/reseller_del.php new file mode 100644 index 0000000000000000000000000000000000000000..8ee40a5c10cfcc475f41541544141172775b3fff --- /dev/null +++ b/interface/web/client/reseller_del.php @@ -0,0 +1,81 @@ +auth->check_module_permissions('client'); + +if($_SESSION["s"]["user"]["typ"] != 'admin') die('Access only for administrators.'); + +$app->uses('tpl,tform'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + function onAfterDelete() { + global $app, $conf; + + $client_id = intval($this->dataRecord['client_id']); + + if($client_id > 0) { + // TODO: Delete all records (sub-clients, mail, web, etc....) of this client. + + // remove the group of the client from the resellers group + $parent_client_id = intval($this->dataRecord['parent_client_id']); + $parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id"); + $client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id"); + $app->auth->remove_group_from_user($parent_user['userid'],$client_group['groupid']); + + // delete the group of the client + $app->db->query("DELETE FROM sys_group WHERE client_id = $client_id"); + + // delete the sys user(s) of the client + $app->db->query("DELETE FROM sys_user WHERE client_id = $client_id"); + } + + } +} + +$page = new page_action; +$page->onDelete() + +?> \ No newline at end of file diff --git a/interface/web/client/reseller_edit.php b/interface/web/client/reseller_edit.php new file mode 100644 index 0000000000000000000000000000000000000000..bbbdd3996056848d7d49a5b768afbc733de4ec62 --- /dev/null +++ b/interface/web/client/reseller_edit.php @@ -0,0 +1,216 @@ +auth->check_module_permissions('client'); + +if($_SESSION["s"]["user"]["typ"] != 'admin') die('Access only for administrators.'); + +// Loading classes +$app->uses('tpl,tform,tform_actions'); +$app->load('tform_actions'); + +class page_action extends tform_actions { + + + function onShowNew() { + global $app, $conf; + + // we will check only users, not admins + if($_SESSION["s"]["user"]["typ"] == 'user') { + + // Get the limits of the client + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + + // Check if the user may add another website. + if($client["limit_client"] >= 0) { + $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = $client_group_id"); + if($tmp["number"] >= $client["limit_client"]) { + $app->error($app->tform->wordbook["limit_client_txt"]); + } + } + } + + parent::onShowNew(); + } + + + function onSubmit() { + global $app, $conf; + + // we will check only users, not admins + if($_SESSION["s"]["user"]["typ"] == 'user' && $this->id == 0) { + + // Get the limits of the client + $client_group_id = $_SESSION["s"]["user"]["default_group"]; + $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); + + // Check if the user may add another website. + if($client["limit_client"] >= 0) { + $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = $client_group_id"); + if($tmp["number"] >= $client["limit_client"]) { + $app->error($app->tform->wordbook["limit_client_txt"]); + } + } + } + + parent::onSubmit(); + } + + + function onShowEnd() { + + global $app; + + $sql = "SELECT template_id,template_name FROM client_template WHERE template_type = 'a'"; + $tpls = $app->db->queryAllRecords($sql); + $option = ''; + $tpl = array(); + foreach($tpls as $item){ + $option .= ''; + $tpl[$item['template_id']] = $item['template_name']; + } + $app->tpl->setVar('tpl_add_select',$option); + + $sql = "SELECT template_additional FROM client WHERE client_id = " . $this->id; + $result = $app->db->queryOneRecord($sql); + $tplAdd = explode("/", $result['template_additional']); + $text = ''; + foreach($tplAdd as $item){ + if (trim($item) != ''){ + if ($text != '') $text .= '
'; + $text .= $tpl[$item]; + } + } + + $app->tpl->setVar('template_additional_list', $text); + + parent::onShowEnd(); + + } + + /* + This function is called automatically right after + the data was successful inserted in the database. + */ + function onAfterInsert() { + global $app; + // Create the group for the reseller + $groupid = $app->db->datalogInsert('sys_group', "(name,description,client_id) VALUES ('".mysql_real_escape_string($this->dataRecord["username"])."','',".$this->id.")", 'groupid'); + $groups = $groupid; + + $username = $app->db->quote($this->dataRecord["username"]); + $password = $app->db->quote($this->dataRecord["password"]); + $modules = ISPC_INTERFACE_MODULES_ENABLED; + if($this->dataRecord["limit_client"] > 0) $modules .= ',client'; + $startmodule = 'mail'; + $usertheme = $app->db->quote($this->dataRecord["usertheme"]); + $type = 'user'; + $active = 1; + $language = $app->db->quote($this->dataRecord["language"]); + + // Create the controlpaneluser for the reseller + $sql = "INSERT INTO sys_user (username,passwort,modules,startmodule,app_theme,typ,active,language,groups,default_group,client_id) + VALUES ('$username',md5('$password'),'$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")"; + $app->db->query($sql); + + //* set the number of clients to 1 + $app->db->query("UPDATE client SET limit_client = 1 WHERE client_id = ".$this->id); + + /* If there is a client-template, process it */ + applyClientTemplates($this->id); + + parent::onAfterInsert(); + } + + + /* + This function is called automatically right after + the data was successful updated in the database. + */ + function onAfterUpdate() { + global $app; + + // username changed + if(isset($this->dataRecord['username']) && $this->dataRecord['username'] != '' && $this->oldDataRecord['username'] != $this->dataRecord['username']) { + $username = $app->db->quote($this->dataRecord["username"]); + $client_id = $this->id; + $sql = "UPDATE sys_user SET username = '$username' WHERE client_id = $client_id"; + $app->db->query($sql); + + $tmp = $app->db->queryOneRecord("SELECT * FROM sys_group WHERE client_id = $client_id"); + $app->db->datalogUpdate("sys_group", "name = '$username'", 'groupid', $tmp['groupid']); + unset($tmp); + } + + // password changed + if(isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') { + $password = $app->db->quote($this->dataRecord["password"]); + $client_id = $this->id; + $sql = "UPDATE sys_user SET passwort = md5('$password') WHERE client_id = $client_id"; + $app->db->query($sql); + } + + // reseller status changed + if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != $this->oldDataRecord["limit_client"]) { + $modules = ISPC_INTERFACE_MODULES_ENABLED; + if($this->dataRecord["limit_client"] > 0) $modules .= ',client'; + $modules = $app->db->quote($modules); + $client_id = $this->id; + $sql = "UPDATE sys_user SET modules = '$modules' WHERE client_id = $client_id"; + $app->db->query($sql); + } + /* + * If there is a client-template, process it */ + applyClientTemplates($this->id); + + parent::onAfterUpdate(); + } +} + +$page = new page_action; +$page->onLoad(); + +?> \ No newline at end of file diff --git a/interface/web/client/reseller_list.php b/interface/web/client/reseller_list.php new file mode 100644 index 0000000000000000000000000000000000000000..4d2a46200fd351b96d9ddd40cdb3e531152898a6 --- /dev/null +++ b/interface/web/client/reseller_list.php @@ -0,0 +1,55 @@ +auth->check_module_permissions('client'); + +if($_SESSION["s"]["user"]["typ"] != 'admin') die('Access only for administrators.'); + +$app->uses('listform_actions'); + +$app->listform_actions->SQLOrderBy = 'ORDER BY company_name, contact_name, client_id'; +$app->listform_actions->SQLExtWhere = "limit_client > 0"; +$app->listform_actions->onLoad(); + + +?> \ No newline at end of file diff --git a/interface/web/client/templates/client_edit_limits.htm b/interface/web/client/templates/client_edit_limits.htm index 208514164f1b333ede2c2f9850137fd020f329af..ee5ab6782d51cc65865a329d4484220d6857cfaf 100644 --- a/interface/web/client/templates/client_edit_limits.htm +++ b/interface/web/client/templates/client_edit_limits.htm @@ -141,10 +141,6 @@ -
- - -
+
+
+ + +
+
+ + +
+
+ + +
+
+

{tmpl_var name='password_strength_txt'}

+
+

 

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + + + +
+ + +
+ + + diff --git a/interface/web/client/templates/reseller_edit_limits.htm b/interface/web/client/templates/reseller_edit_limits.htm new file mode 100644 index 0000000000000000000000000000000000000000..7e027e44e05f3a5965b499feaa8e4f67944209f9 --- /dev/null +++ b/interface/web/client/templates/reseller_edit_limits.htm @@ -0,0 +1,171 @@ +

+

+ +
+ +
+
Limits + +
+ + +
+
+ + + {tmpl_var name='template_additional_list'} + +
+
+   +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +  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'} +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ + +
+
+ +
diff --git a/interface/web/client/templates/resellers_list.htm b/interface/web/client/templates/resellers_list.htm new file mode 100644 index 0000000000000000000000000000000000000000..4f15202c26fac5a89cd22533e6687f377e8af4a3 --- /dev/null +++ b/interface/web/client/templates/resellers_list.htm @@ -0,0 +1,62 @@ +

+

+ +
+ +
+
Tools +
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
{tmpl_var name="client_id"}{tmpl_var name="company_name"}{tmpl_var name="contact_name"}{tmpl_var name="city"}{tmpl_var name="country"} + +
+
+
+ +