You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id." AND ".$this->getAuthSQL('r', $this->formDef['db_table']);
1276
1279
return$app->db->queryOneRecord($sql);
1277
1280
}
@@ -1285,6 +1288,11 @@ function datalogSave($action, $primary_id, $record_old, $record_new) {
1285
1288
}
1286
1289
1287
1290
functiongetAuthSQL($perm, $table = '') {
1291
+
global$app;
1292
+
1293
+
$perm = $app->db->quote($perm);
1294
+
$table = $app->db->quote($table);
1295
+
1288
1296
if($_SESSION["s"]["user"]["typ"] == 'admin') {
1289
1297
return'1';
1290
1298
} else {
@@ -1309,6 +1317,7 @@ function getAuthSQL($perm, $table = '') {
1309
1317
functioncheckPerm($record_id, $perm) {
1310
1318
global$app;
1311
1319
1320
+
$record_id = $app->functions->intval($record_id);
1312
1321
if($record_id > 0) {
1313
1322
// Add backticks for incomplete table names.
1314
1323
if(stristr($this->formDef['db_table'], '.')) {
@@ -1403,7 +1412,7 @@ function checkClientLimit($limit_name, $sql_where = '') {
1403
1412
if($limit_name == '') $app->error('Limit name missing in function checkClientLimit.');
1404
1413
1405
1414
// Get the limits of the client that is currently logged in
$client = $app->db->queryOneRecord("SELECT $limit_name as number, parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
1408
1417
1409
1418
// Check if the user may add another item
@@ -1425,7 +1434,7 @@ function checkResellerLimit($limit_name, $sql_where = '') {
1425
1434
if($limit_name == '') $app->error('Limit name missing in function checkClientLimit.');
1426
1435
1427
1436
// Get the limits of the client that is currently logged in
$client = $app->db->queryOneRecord("SELECT parent_client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
1430
1439
1431
1440
//* If the client belongs to a reseller, we will check against the reseller Limit too
$client = $app->db->queryOneRecord("SELECT client.locked FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ".$app->functions->intval($client_group_id));
Copy file name to clipboardExpand all lines: interface/lib/classes/validate_client.inc.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ function username_unique($field_name, $field_value, $validator) {
53
53
}
54
54
}
55
55
} else {
56
-
$num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM sys_user WHERE username = '".$app->db->quote($field_value)."' AND client_id != ".$client_id);
56
+
$num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM sys_user WHERE username = '".$app->db->quote($field_value)."' AND client_id != ".$app->functions->intval($client_id));
$check_parent_domain = $app->db->queryOneRecord("SELECT * FROM `web_domain` WHERE `domain_id` = ".$check['parent_domain_id']);
220
+
$check_parent_domain = $app->db->queryOneRecord("SELECT * FROM `web_domain` WHERE `domain_id` = ".$app->functions->intval($check['parent_domain_id']));
$client = $app->db->queryOneRecord("SELECT limit_wildcard FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
$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");
62
62
63
63
// Check if the user may add another mailbox.
@@ -84,7 +84,7 @@ function onSubmit() {
84
84
// Check the client limits, if user is not the admin
85
85
if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
$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");
89
89
90
90
// Check if the user may add another mailbox.
@@ -97,7 +97,7 @@ function onSubmit() {
97
97
} // end if user is not admin
98
98
99
99
//* Check for duplicates where IP and hostname are the same
100
-
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = '".$this->dataRecord["name"]."' AND zone = '".$this->dataRecord["zone"]."' and data = '".$this->dataRecord["data"]."' and id != ".$this->id.") OR (type = 'CNAME' AND name = '".$this->dataRecord["name"]."' AND zone = '".$this->dataRecord["zone"]."' and id != ".$this->id.")");
100
+
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = '".$app->db->quote($this->dataRecord["name"])."' AND zone = '".$app->db->quote($this->dataRecord["zone"])."' and data = '".$app->db->quote($this->dataRecord["data"])."' and id != ".$this->id.") OR (type = 'CNAME' AND name = '".$app->db->quote($this->dataRecord["name"])."' AND zone = '".$app->db->quote($this->dataRecord["zone"])."' and id != ".$this->id.")");
$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");
89
89
90
90
// Check if the user may add another mailbox.
@@ -113,7 +113,7 @@ function onAfterInsert() {
113
113
114
114
//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
115
115
$soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
$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");
62
62
63
63
// Check if the user may add another mailbox.
@@ -84,7 +84,7 @@ function onSubmit() {
84
84
// Check the client limits, if user is not the admin
85
85
if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
$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");
$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");
62
62
63
63
// Check if the user may add another mailbox.
@@ -84,7 +84,7 @@ function onSubmit() {
84
84
// Check the client limits, if user is not the admin
85
85
if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
$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");
89
89
90
90
// Check if the user may add another mailbox.
@@ -97,7 +97,7 @@ function onSubmit() {
97
97
} // end if user is not admin
98
98
99
99
//* Check for duplicates where IP and hostname are the same
100
-
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = '".$this->dataRecord["name"]."' AND zone = '".$this->dataRecord["zone"]."' and id != ".$this->id.") OR (type = 'CNAME' AND name = '".$this->dataRecord["name"]."' AND zone = '".$this->dataRecord["zone"]."' and id != ".$this->id.")");
100
+
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE (type = 'A' AND name = '".$app->db->quote($this->dataRecord["name"])."' AND zone = '".$app->db->quote($this->dataRecord["zone"])."' and id != ".$this->id.") OR (type = 'CNAME' AND name = '".$app->db->quote($this->dataRecord["name"])."' AND zone = '".$app->db->quote($this->dataRecord["zone"])."' and id != ".$this->id.")");
$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");
62
62
63
63
// Check if the user may add another mailbox.
@@ -84,7 +84,7 @@ function onSubmit() {
84
84
// Check the client limits, if user is not the admin
85
85
if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
$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");
0 commit comments