From 2be1de4e523cea741a000cd21acd166660d8b9c8 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Thu, 23 Jun 2016 11:57:39 -0400
Subject: [PATCH] Fix for an issue where plugins dont get loaded when logged in with "Login as".
---
interface/web/sites/database_user_edit.php | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/interface/web/sites/database_user_edit.php b/interface/web/sites/database_user_edit.php
index 90b28ef..02ef7bf 100644
--- a/interface/web/sites/database_user_edit.php
+++ b/interface/web/sites/database_user_edit.php
@@ -50,6 +50,22 @@
class page_action extends tform_actions {
+ function onShowNew() {
+ global $app;
+
+ // we will check only users, not admins
+ if($_SESSION['s']['user']['typ'] == 'user') {
+ if(!$app->tform->checkClientLimit('limit_database_user')) {
+ $app->error($app->tform->wordbook["limit_database_user_txt"]);
+ }
+ if(!$app->tform->checkResellerLimit('limit_database_user')) {
+ $app->error('Reseller: '.$app->tform->wordbook["limit_database_user_txt"]);
+ }
+ }
+
+ parent::onShowNew();
+ }
+
function onShowEnd() {
global $app, $conf, $interfaceConf;
@@ -153,10 +169,11 @@
/* prepare password for MongoDB */
// TODO: this still doens't work as when only the username changes we have no database_password.
// taking the one from oldData doesn't work as it's encrypted...shit!
+/*
$this->dataRecord['database_password_mongo'] = $this->dataRecord['database_user'].":mongo:".$this->dataRecord['database_password'];
$this->dataRecord['server_id'] = 0; // we need this on all servers
-
+*/
parent::onBeforeUpdate();
}
@@ -190,7 +207,7 @@
$this->dataRecord['server_id'] = 0; // we need this on all servers
/* prepare password for MongoDB */
- $this->dataRecord['database_password_mongo'] = $this->dataRecord['database_user'].":mongo:".$this->dataRecord['database_password'];
+// $this->dataRecord['database_password_mongo'] = $this->dataRecord['database_user'].":mongo:".$this->dataRecord['database_password'];
parent::onBeforeInsert();
}
--
Gitblit v1.9.1