From aec1333faab59d5de487ecee0da059449e9c21fd Mon Sep 17 00:00:00 2001 From: horfic <horfic@ispconfig3> Date: Mon, 10 Jan 2011 08:29:51 -0500 Subject: [PATCH] *) Changed remote function sites_web_domain_add to allow readonly website to be created *) Forgot to add the entries for mailman in the main.cf of postfix --- interface/lib/classes/validate_client.inc.php | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/interface/lib/classes/validate_client.inc.php b/interface/lib/classes/validate_client.inc.php index 1124d72..97b9221 100644 --- a/interface/lib/classes/validate_client.inc.php +++ b/interface/lib/classes/validate_client.inc.php @@ -36,7 +36,13 @@ function username_unique($field_name, $field_value, $validator) { global $app; - if($app->tform->primary_id == 0) { + if(isset($app->remoting_lib->primary_id)) { + $client_id = $app->remoting_lib->primary_id; + } else { + $client_id = $app->tform->primary_id; + } + + if($client_id == 0) { $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM sys_user WHERE username = '".$app->db->quote($field_value)."'"); if($num_rec["number"] > 0) { $errmsg = $validator['errmsg']; @@ -47,7 +53,7 @@ } } } else { - $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM sys_user WHERE username = '".$app->db->quote($field_value)."' AND client_id != ".$app->tform->primary_id); + $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM sys_user WHERE username = '".$app->db->quote($field_value)."' AND client_id != ".$client_id); if($num_rec["number"] > 0) { $errmsg = $validator['errmsg']; if(isset($app->tform->wordbook[$errmsg])) { -- Gitblit v1.9.1