From 2d2fd172e1548dd24e1719accd0b856cff6a31a0 Mon Sep 17 00:00:00 2001 From: Falko Timme <ft@falkotimme.com> Date: Fri, 18 Oct 2013 12:20:13 -0400 Subject: [PATCH] - Added funtion to convert currency formatted numbers back to floating numbers. - Improved getSearchSQL() function so that users can use their native date format so search for dates in lists. --- interface/web/sites/shell_user_edit.php | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) diff --git a/interface/web/sites/shell_user_edit.php b/interface/web/sites/shell_user_edit.php index 6939d4a..a18dd8e 100644 --- a/interface/web/sites/shell_user_edit.php +++ b/interface/web/sites/shell_user_edit.php @@ -99,7 +99,17 @@ global $app, $conf; // Get the record of the parent domain - $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"])); + //$parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r')); + //if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm"); + if(isset($this->dataRecord["parent_domain_id"])) { + $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r')); + if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm"); + } else { + $tmp = $app->tform->getDataRecord($this->id); + $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ".$app->functions->intval($tmp["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r')); + if(!$parent_domain) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm"); + unset($tmp); + } // Set a few fixed values $this->dataRecord["server_id"] = $parent_domain["server_id"]; @@ -121,7 +131,7 @@ $blacklist = file(ISPC_LIB_PATH.'/shelluser_blacklist'); foreach($blacklist as $line) { if(strtolower(trim($line)) == strtolower(trim($this->dataRecord['username']))){ - $app->tform->errorMessage .= 'The username is not allowed.'; + $app->tform->errorMessage .= $app->tform->lng('username_not_allowed_txt'); } } unset($blacklist); @@ -138,6 +148,8 @@ $this->dataRecord['username_prefix'] = $shelluser_prefix; /* restrict the names */ $this->dataRecord['username'] = $shelluser_prefix . $this->dataRecord['username']; + + if(strlen($this->dataRecord['username']) > 32) $app->tform->errorMessage .= $app->tform->lng("username_must_not_exceed_32_chars_txt"); } parent::onBeforeInsert(); } @@ -166,7 +178,7 @@ $blacklist = file(ISPC_LIB_PATH.'/shelluser_blacklist'); foreach($blacklist as $line) { if(strtolower(trim($line)) == strtolower(trim($this->dataRecord['username']))){ - $app->tform->errorMessage .= 'The username is not allowed.'; + $app->tform->errorMessage .= $app->tform->lng('username_not_allowed_txt'); } } unset($blacklist); @@ -188,6 +200,8 @@ /* restrict the names */ $this->dataRecord['username'] = $shelluser_prefix . $this->dataRecord['username']; + + if(strlen($this->dataRecord['username']) > 32) $app->tform->errorMessage .= $app->tform->lng("username_must_not_exceed_32_chars_txt"); } } -- Gitblit v1.9.1