From cab7ea5faaa2f3510c8488e7d19d083fc05ac6ca Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Wed, 18 Sep 2013 04:17:27 -0400
Subject: [PATCH] - Fixed missing global $app in new _decode function
---
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