From 8216c5ee690f97b9f8f8ac967dac5c5f3745a00f Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Tue, 12 Apr 2016 06:18:24 -0400
Subject: [PATCH] Fixed: Issue #3820 v3.1 Shell user wrong default Base Dir in GUI results to corrupt shell user home directory creation.
---
interface/web/sites/shell_user_edit.php | 23 +----------------------
1 files changed, 1 insertions(+), 22 deletions(-)
diff --git a/interface/web/sites/shell_user_edit.php b/interface/web/sites/shell_user_edit.php
index 2b606c2..77c4509 100644
--- a/interface/web/sites/shell_user_edit.php
+++ b/interface/web/sites/shell_user_edit.php
@@ -95,12 +95,6 @@
} else {
$app->tpl->setVar("edit_disabled", 0);
}
-
- if($this->dataRecord['chroot'] == 'jailkit'){
- $app->tpl->setVar("is_jailkit", true);
- } else {
- $app->tpl->setVar("is_jailkit", false);
- }
parent::onShowEnd();
}
@@ -170,11 +164,7 @@
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $this->dataRecord["parent_domain_id"]);
$server_id = $app->functions->intval($web["server_id"]);
- if($this->dataRecord['chroot'] == 'jailkit'){
- $dir = $app->db->quote($web["document_root"]);
- } else {
- $dir = $app->db->quote($web["document_root"].'/home/'.$this->dataRecord['username']);
- }
+ $dir = $web["document_root"];
$uid = $web["system_user"];
$gid = $web["system_group"];
@@ -228,18 +218,7 @@
function onAfterUpdate() {
global $app, $conf;
- if(isset($this->dataRecord['chroot'])){
- $shell_user = $app->db->queryOneRecord("SELECT * FROM shell_user WHERE shell_user_id = ".$this->id);
- $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->dataRecord["parent_domain_id"]));
- $dir = $shell_user['dir'];
- if($this->dataRecord['chroot'] == 'jailkit'){
- $dir = $app->db->quote($web["document_root"]);
- } else {
- if($this->oldDataRecord['chroot'] == 'jailkit') $dir = $app->db->quote($web["document_root"].'/home/'.$this->dataRecord['username']);
- }
- if($dir != $shell_user['dir']) $app->db->query("UPDATE shell_user SET dir = '$dir' WHERE shell_user_id = ".$this->id);
- }
}
}
--
Gitblit v1.9.1