From ea379616f044da73c8f927e2ed4bbb23516c8fdb Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 02 Aug 2007 08:20:10 -0400
Subject: [PATCH] Added client limits to the DNS module.
---
interface/web/dns/lib/lang/en_dns_ns.lng | 2
interface/web/dns/lib/lang/en_dns_soa.lng | 33 +-
interface/web/dns/dns_mx_edit.php | 41 +++
interface/web/dns/lib/lang/en_dns_alias.lng | 2
interface/web/dns/form/dns_soa.tform.php | 3
interface/web/dns/lib/lang/en_dns_hinfo.lng | 2
interface/web/dns/templates/dns_a_list.htm | 7
interface/web/client/lib/lang/en_client.lng | 4
interface/web/dns/lib/lang/en_dns_a.lng | 2
interface/web/dns/dns_ns_edit.php | 41 +++
interface/web/dns/lib/lang/en_dns_cname.lng | 2
interface/web/client/client_edit.php | 2
interface/web/dns/dns_srv_edit.php | 41 +++
interface/web/dns/dns_alias_edit.php | 41 +++
interface/web/dns/lib/lang/en_dns_srv.lng | 2
interface/web/dns/dns_ptr_edit.php | 41 +++
interface/web/dns/dns_hinfo_edit.php | 41 +++
interface/web/dns/dns_soa_edit.php | 91 ++++++++
interface/web/dns/dns_cname_edit.php | 41 +++
interface/web/dns/list/dns_a.list.php | 9
interface/web/dns/templates/dns_soa_edit.htm | 10
interface/web/client/templates/client_edit_limits.htm | 19 +
interface/web/dns/dns_a_edit.php | 41 +++
interface/web/client/form/client.tform.php | 43 +++
interface/web/dns/lib/lang/en_dns_txt.lng | 2
interface/web/dns/dns_txt_edit.php | 41 +++
interface/web/dns/lib/lang/en_dns_a_list.lng | 1
interface/web/dns/dns_rp_edit.php | 41 +++
interface/web/dns/lib/lang/en_dns_ptr.lng | 2
interface/web/dns/lib/lang/en_dns_rp.lng | 2
interface/web/dns/lib/lang/en_dns_mx.lng | 2
31 files changed, 631 insertions(+), 21 deletions(-)
diff --git a/interface/web/client/client_edit.php b/interface/web/client/client_edit.php
index b7e9cfd..473de4b 100644
--- a/interface/web/client/client_edit.php
+++ b/interface/web/client/client_edit.php
@@ -66,7 +66,7 @@
$username = addslashes($this->dataRecord["username"]);
$password = addslashes($this->dataRecord["password"]);
- $modules = 'mail,sites';
+ $modules = 'mail,sites,dns';
$startmodule = 'mail';
$usertheme = addslashes($this->dataRecord["usertheme"]);
$type = 'user';
diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php
index 6aba152..d87e2f9 100644
--- a/interface/web/client/form/client.tform.php
+++ b/interface/web/client/form/client.tform.php
@@ -285,7 +285,7 @@
'formtype' => 'SELECT',
'default' => '1',
'datasource' => array ( 'type' => 'SQL',
- 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
+ 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND {AUTHSQL} ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
@@ -464,7 +464,7 @@
'formtype' => 'SELECT',
'default' => '1',
'datasource' => array ( 'type' => 'SQL',
- 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
+ 'querystring' => 'SELECT server_id,server_name FROM server WHERE web_server = 1 AND {AUTHSQL} ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
@@ -526,6 +526,45 @@
'rows' => '',
'cols' => ''
),
+ '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_zone_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.lng b/interface/web/client/lib/lang/en_client.lng
index 90472f6..435a290 100644
--- a/interface/web/client/lib/lang/en_client.lng
+++ b/interface/web/client/lib/lang/en_client.lng
@@ -50,5 +50,9 @@
$wb["limit_web_aliasdomain_txt"] = 'Max. number of web aliasdomains';
$wb["limit_web_subdomain_txt"] = 'Max. number of web subdomains';
$wb["limit_ftp_user_txt"] = 'Max. number of FTP users';
+$wb["default_dnsserver_txt"] = 'Default DNS Server';
+$wb["limit_dns_zone_txt"] = 'Max. number of DNS zones';
+$wb["limit_dns_record_txt"] = 'Max. number DNS records';
+
?>
\ 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 979e9d9..e33d0b3 100644
--- a/interface/web/client/templates/client_edit_limits.htm
+++ b/interface/web/client/templates/client_edit_limits.htm
@@ -91,6 +91,25 @@
<td class="frmText11" width="220"><input name="limit_ftp_user" type="text" class="text" value="{tmpl_var name='limit_ftp_user'}" size="10" maxlength="10"></td>
</tr>
<tr>
+ <td><h2>DNS</h2></td>
+ </tr>
+ <tr>
+ <td class="frmText11">{tmpl_var name='default_dnsserver_txt'}:</td>
+ <td class="frmText11">
+ <select name="default_dnsserver" class="text">
+ {tmpl_var name='default_dnsserver'}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td class="frmText11" width="280">{tmpl_var name='limit_dns_zone_txt'}:</td>
+ <td class="frmText11" width="220"><input name="limit_dns_zone" type="text" class="text" value="{tmpl_var name='limit_dns_zone'}" size="10" maxlength="10"></td>
+ </tr>
+ <tr>
+ <td class="frmText11" width="280">{tmpl_var name='limit_dns_record_txt'}:</td>
+ <td class="frmText11" width="220"><input name="limit_dns_record" type="text" class="text" value="{tmpl_var name='limit_dns_record'}" size="10" maxlength="10"></td>
+ </tr>
+ <tr>
<td class="frmText11"> </td>
<td class="frmText11"> </td>
</tr>
diff --git a/interface/web/dns/dns_a_edit.php b/interface/web/dns/dns_a_edit.php
index 03609bd..ed14342 100644
--- a/interface/web/dns/dns_a_edit.php
+++ b/interface/web/dns/dns_a_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/dns_alias_edit.php b/interface/web/dns/dns_alias_edit.php
index 8f8e0ec..f08280d 100644
--- a/interface/web/dns/dns_alias_edit.php
+++ b/interface/web/dns/dns_alias_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/dns_cname_edit.php b/interface/web/dns/dns_cname_edit.php
index a9a6c32..7ea775c 100644
--- a/interface/web/dns/dns_cname_edit.php
+++ b/interface/web/dns/dns_cname_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/dns_hinfo_edit.php b/interface/web/dns/dns_hinfo_edit.php
index 891069e..b2286c2 100644
--- a/interface/web/dns/dns_hinfo_edit.php
+++ b/interface/web/dns/dns_hinfo_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/dns_mx_edit.php b/interface/web/dns/dns_mx_edit.php
index 0dc6b91..d21a99f 100644
--- a/interface/web/dns/dns_mx_edit.php
+++ b/interface/web/dns/dns_mx_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/dns_ns_edit.php b/interface/web/dns/dns_ns_edit.php
index a7889ae..17e4667 100644
--- a/interface/web/dns/dns_ns_edit.php
+++ b/interface/web/dns/dns_ns_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/dns_ptr_edit.php b/interface/web/dns/dns_ptr_edit.php
index e353c7a..1250523 100644
--- a/interface/web/dns/dns_ptr_edit.php
+++ b/interface/web/dns/dns_ptr_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/dns_rp_edit.php b/interface/web/dns/dns_rp_edit.php
index 1ed1582..a97574a 100644
--- a/interface/web/dns/dns_rp_edit.php
+++ b/interface/web/dns/dns_rp_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/dns_soa_edit.php b/interface/web/dns/dns_soa_edit.php
index 1a7bfa5..f78e9aa 100644
--- a/interface/web/dns/dns_soa_edit.php
+++ b/interface/web/dns/dns_soa_edit.php
@@ -53,8 +53,75 @@
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_dns_zone 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 maildomain.
+ if($client["limit_dns_zone"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_zone"]) {
+ $app->error($app->tform->wordbook["limit_dns_zone_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
+ function onShowEnd() {
+ global $app, $conf;
+
+ // If user is admin, we will allow him to select to whom this record belongs
+ if($_SESSION["s"]["user"]["typ"] == 'admin') {
+ // Getting Domains of the user
+ $sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0";
+ $clients = $app->db->queryAllRecords($sql);
+ $client_select = "<option value='0'></option>";
+ if(is_array($clients)) {
+ foreach( $clients as $client) {
+ $selected = ($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
+ $client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
+ }
+ }
+ $app->tpl->setVar("client_group_id",$client_select);
+ }
+
+ parent::onShowEnd();
+ }
+
function onSubmit() {
global $app, $conf;
+
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_zone, default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
+
+ // When the record is updated
+ if($this->id > 0) {
+ // restore the server ID if the user is not admin and record is edited
+ $tmp = $app->db->queryOneRecord("SELECT server_id FROM dns_soa WHERE id = ".intval($this->id));
+ $this->dataRecord["server_id"] = $tmp["server_id"];
+ unset($tmp);
+ // When the record is inserted
+ } else {
+ // set the server ID to the default mailserver of the client
+ $this->dataRecord["server_id"] = $client["default_dnsserver"];
+
+ // Check if the user may add another maildomain.
+ if($client["limit_dns_zone"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_zone"]) {
+ $app->error($app->tform->wordbook["limit_dns_zone_txt"]);
+ }
+ }
+ }
// Set the serial
$this->dataRecord["serial"] = time();
@@ -62,6 +129,30 @@
parent::onSubmit();
}
+ function onAfterInsert() {
+ global $app, $conf;
+
+ // make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it
+ if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
+ $client_group_id = intval($this->dataRecord["client_group_id"]);
+ $app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id WHERE id = ".$this->id);
+ // And we want to update all rr records too, that belong to this record
+ $app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id);
+ }
+ }
+
+ function onAfterUpdate() {
+ global $app, $conf;
+
+ // make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it
+ if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
+ $client_group_id = intval($this->dataRecord["client_group_id"]);
+ $app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id WHERE id = ".$this->id);
+ // And we want to update all rr records too, that belong to this record
+ $app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id);
+ }
+ }
+
}
$page = new page_action;
diff --git a/interface/web/dns/dns_srv_edit.php b/interface/web/dns/dns_srv_edit.php
index a98733d..200c03c 100644
--- a/interface/web/dns/dns_srv_edit.php
+++ b/interface/web/dns/dns_srv_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/dns_txt_edit.php b/interface/web/dns/dns_txt_edit.php
index 2d3ec80..d8e7da1 100644
--- a/interface/web/dns/dns_txt_edit.php
+++ b/interface/web/dns/dns_txt_edit.php
@@ -53,11 +53,52 @@
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_dns_record 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 mailbox.
+ if($client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onSubmit() {
global $app, $conf;
// Get the parent soa record of the domain
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+
+ // Check if Domain belongs to user
+ if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
+
+ // Check the client limits, if user is not the admin
+ if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
+ // Get the limits of the client
+ $client_group_id = $_SESSION["s"]["user"]["default_group"];
+ $client = $app->db->queryOneRecord("SELECT limit_dns_record 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 mailbox.
+ if($this->id == 0 && $client["limit_dns_record"] >= 0) {
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
+ if($tmp["number"] >= $client["limit_dns_record"]) {
+ $app->error($app->tform->wordbook["limit_dns_record_txt"]);
+ }
+ }
+ } // end if user is not admin
+
// Set the server ID of the rr record to the same server ID as the parent record.
$this->dataRecord["server_id"] = $soa["server_id"];
diff --git a/interface/web/dns/form/dns_soa.tform.php b/interface/web/dns/form/dns_soa.tform.php
index cf5f0d1..89ff4f9 100644
--- a/interface/web/dns/form/dns_soa.tform.php
+++ b/interface/web/dns/form/dns_soa.tform.php
@@ -107,7 +107,8 @@
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'mbox_error_empty'),
- 1 => array ( 'type' => 'ISEMAIL',
+ 0 => array ( 'type' => 'REGEX',
+ 'regex' => '/^[\w\.\-]{0,64}$/',
'errmsg'=> 'mbox_error_regex'),
),
'default' => '',
diff --git a/interface/web/dns/lib/lang/en_dns_a.lng b/interface/web/dns/lib/lang/en_dns_a.lng
index ca96ae5..57ce73d 100644
--- a/interface/web/dns/lib/lang/en_dns_a.lng
+++ b/interface/web/dns/lib/lang/en_dns_a.lng
@@ -8,4 +8,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_a_list.lng b/interface/web/dns/lib/lang/en_dns_a_list.lng
index cabd478..da211f7 100644
--- a/interface/web/dns/lib/lang/en_dns_a_list.lng
+++ b/interface/web/dns/lib/lang/en_dns_a_list.lng
@@ -4,6 +4,7 @@
$wb["server_id_txt"] = 'Server';
$wb["zone_txt"] = 'Zone';
$wb["name_txt"] = 'Name';
+$wb["data_txt"] = 'Data';
$wb["type_txt"] = 'Type';
$wb["page_txt"] = 'Page';
$wb["page_of_txt"] = 'of';
diff --git a/interface/web/dns/lib/lang/en_dns_alias.lng b/interface/web/dns/lib/lang/en_dns_alias.lng
index 187a110..d3a1b0a 100644
--- a/interface/web/dns/lib/lang/en_dns_alias.lng
+++ b/interface/web/dns/lib/lang/en_dns_alias.lng
@@ -8,4 +8,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_cname.lng b/interface/web/dns/lib/lang/en_dns_cname.lng
index 187a110..d3a1b0a 100644
--- a/interface/web/dns/lib/lang/en_dns_cname.lng
+++ b/interface/web/dns/lib/lang/en_dns_cname.lng
@@ -8,4 +8,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_hinfo.lng b/interface/web/dns/lib/lang/en_dns_hinfo.lng
index 5b4a204..e5eae73 100644
--- a/interface/web/dns/lib/lang/en_dns_hinfo.lng
+++ b/interface/web/dns/lib/lang/en_dns_hinfo.lng
@@ -8,4 +8,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_mx.lng b/interface/web/dns/lib/lang/en_dns_mx.lng
index 55ebd0a..ca65b42 100644
--- a/interface/web/dns/lib/lang/en_dns_mx.lng
+++ b/interface/web/dns/lib/lang/en_dns_mx.lng
@@ -9,4 +9,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_ns.lng b/interface/web/dns/lib/lang/en_dns_ns.lng
index c430cdd..5c2792d 100644
--- a/interface/web/dns/lib/lang/en_dns_ns.lng
+++ b/interface/web/dns/lib/lang/en_dns_ns.lng
@@ -8,4 +8,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_ptr.lng b/interface/web/dns/lib/lang/en_dns_ptr.lng
index 5e7f86d..5edf14c 100644
--- a/interface/web/dns/lib/lang/en_dns_ptr.lng
+++ b/interface/web/dns/lib/lang/en_dns_ptr.lng
@@ -8,4 +8,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_rp.lng b/interface/web/dns/lib/lang/en_dns_rp.lng
index 2f54176..def925f 100644
--- a/interface/web/dns/lib/lang/en_dns_rp.lng
+++ b/interface/web/dns/lib/lang/en_dns_rp.lng
@@ -8,4 +8,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_soa.lng b/interface/web/dns/lib/lang/en_dns_soa.lng
index 4955dff..573c795 100644
--- a/interface/web/dns/lib/lang/en_dns_soa.lng
+++ b/interface/web/dns/lib/lang/en_dns_soa.lng
@@ -1,16 +1,19 @@
-<?php
-$wb["btn_save_txt"] = 'Save';
-$wb["btn_cancel_txt"] = 'Cancel';
-$wb["server_id_txt"] = 'Server';
-$wb["origin_txt"] = 'Zone (SOA)';
-$wb["ns_txt"] = 'NS';
-$wb["mbox_txt"] = 'Email';
-$wb["serial_txt"] = 'Serial';
-$wb["refresh_txt"] = 'Refresh';
-$wb["retry_txt"] = 'Retry';
-$wb["expire_txt"] = 'Expire';
-$wb["minimum_txt"] = 'Minimum';
-$wb["ttl_txt"] = 'TTL';
-$wb["xfer_txt"] = 'Xfer (IP)';
-$wb["active_txt"] = 'Active';
+<?php
+$wb["btn_save_txt"] = 'Save';
+$wb["btn_cancel_txt"] = 'Cancel';
+$wb["server_id_txt"] = 'Server';
+$wb["origin_txt"] = 'Zone (SOA)';
+$wb["ns_txt"] = 'NS';
+$wb["mbox_txt"] = 'Email';
+$wb["serial_txt"] = 'Serial';
+$wb["refresh_txt"] = 'Refresh';
+$wb["retry_txt"] = 'Retry';
+$wb["expire_txt"] = 'Expire';
+$wb["minimum_txt"] = 'Minimum';
+$wb["ttl_txt"] = 'TTL';
+$wb["xfer_txt"] = 'Xfer (IP)';
+$wb["active_txt"] = 'Active';
+$wb["limit_dns_zone_txt"] = 'The max. number of DNS zones for your account is reached.';
+$wb["client_txt"] = 'Client';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_srv.lng b/interface/web/dns/lib/lang/en_dns_srv.lng
index 9c16bdc..92110de 100644
--- a/interface/web/dns/lib/lang/en_dns_srv.lng
+++ b/interface/web/dns/lib/lang/en_dns_srv.lng
@@ -8,4 +8,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/lib/lang/en_dns_txt.lng b/interface/web/dns/lib/lang/en_dns_txt.lng
index 89b4cc4..be40344 100644
--- a/interface/web/dns/lib/lang/en_dns_txt.lng
+++ b/interface/web/dns/lib/lang/en_dns_txt.lng
@@ -8,4 +8,6 @@
$wb["active_txt"] = 'Active';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
+$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
+$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
?>
\ No newline at end of file
diff --git a/interface/web/dns/list/dns_a.list.php b/interface/web/dns/list/dns_a.list.php
index 7c9511a..9e6ed6c 100644
--- a/interface/web/dns/list/dns_a.list.php
+++ b/interface/web/dns/list/dns_a.list.php
@@ -95,6 +95,15 @@
'width' => "",
'value' => "");
+$liste["item"][] = array( 'field' => "data",
+ 'datatype' => "VARCHAR",
+ 'formtype' => "TEXT",
+ 'op' => "like",
+ 'prefix' => "%",
+ 'suffix' => "%",
+ 'width' => "",
+ 'value' => "");
+
$liste["item"][] = array( 'field' => "type",
'datatype' => "VARCHAR",
diff --git a/interface/web/dns/templates/dns_a_list.htm b/interface/web/dns/templates/dns_a_list.htm
index e5184be..38a22ec 100644
--- a/interface/web/dns/templates/dns_a_list.htm
+++ b/interface/web/dns/templates/dns_a_list.htm
@@ -14,12 +14,14 @@
<td class="tblHead"><tmpl_var name="active_txt"></td>
<td class="tblHead"><tmpl_var name="type_txt"></td>
<td class="tblHead"><tmpl_var name="name_txt"></td>
+ <td class="tblHead"><tmpl_var name="data_txt"></td>
<td class="tblHead"> </td>
</tr>
<tr>
<td class="frmText11"><select name="search_active" onChange="changeTab('dns_records','dns/dns_soa_edit.php');">{tmpl_var name='search_active'}</select></td>
<td class="frmText11"><select name="search_type" onChange="changeTab('dns_records','dns/dns_soa_edit.php');">{tmpl_var name='search_type'}</select></td>
- <td class="frmText11"><input type="text" name="search_name" value="{tmpl_var name='search_name'}" class="text" /></td>
+ <td class="frmText11"><input type="text" name="search_name" value="{tmpl_var name='search_name'}" class="text" width="10" /></td>
+ <td class="frmText11"><input type="text" name="search_data" value="{tmpl_var name='search_data'}" class="text" width="10" /></td>
<td class="frmText11" align="right"><input name="Filter" type="button" id="Filter" value="{tmpl_var name="filter_txt"}" class="button" onClick="changeTab('dns_records','dns/dns_soa_edit.php');"><div class="buttonEnding"></div></td>
</tr>
<tmpl_loop name="records">
@@ -27,10 +29,11 @@
<td class="frmText11"><a href="#" onClick="loadContent('dns/dns_{tmpl_var name='type_lowercase'}_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="active"}</a></td>
<td class="frmText11"><a href="#" onClick="loadContent('dns/dns_{tmpl_var name='type_lowercase'}_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="type"}</a></td>
<td class="frmText11"><a href="#" onClick="loadContent('dns/dns_{tmpl_var name='type_lowercase'}_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="name"}</a></td>
+ <td class="frmText11"><a href="#" onClick="loadContent('dns/dns_{tmpl_var name='type_lowercase'}_edit.php?id={tmpl_var name='id'}');" class="frmText11">{tmpl_var name="data"}</a></td>
<td class="frmText11" align="right">[<a href="javascript: del_record('dns/dns_rr_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}');" class="frmText11">{tmpl_var name='delete_txt'}</a>]</td>
</tr>
</tmpl_loop>
<tr>
- <td colspan="4" height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
+ <td colspan="5" height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
</tr>
</table>
\ No newline at end of file
diff --git a/interface/web/dns/templates/dns_soa_edit.htm b/interface/web/dns/templates/dns_soa_edit.htm
index c78e692..03d3ab0 100644
--- a/interface/web/dns/templates/dns_soa_edit.htm
+++ b/interface/web/dns/templates/dns_soa_edit.htm
@@ -1,4 +1,5 @@
<table width="800" border="0" cellspacing="0" cellpadding="2">
+ <tmpl_if name="is_admin">
<tr>
<td class="frmText11">{tmpl_var name='server_id_txt'}:</td>
<td class="frmText11">
@@ -8,6 +9,15 @@
</td>
</tr>
<tr>
+ <td class="frmText11">{tmpl_var name='client_txt'}:</td>
+ <td class="frmText11">
+ <select name="client_group_id" class="text">
+ {tmpl_var name='client_group_id'}
+ </select>
+ </td>
+ </tr>
+ </tmpl_if>
+ <tr>
<td class="frmText11">{tmpl_var name='origin_txt'}:</td>
<td class="frmText11"><input name="origin" type="text" class="text" value="{tmpl_var name='origin'}" size="30" maxlength="255"> e.g. mydomain.com.</td>
</tr>
--
Gitblit v1.9.1