From d5628a9b2f745989db70913a54ac6b730b2a1735 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 15 Jun 2010 15:00:19 +0000
Subject: [PATCH] Fixed permission problem in remoting API:
 http://www.howtoforge.com/forums/showthread.php?t=46539

---
 interface/lib/classes/remoting_lib.inc.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php
index 06a4d6d83..da5c22814 100644
--- a/interface/lib/classes/remoting_lib.inc.php
+++ b/interface/lib/classes/remoting_lib.inc.php
@@ -166,7 +166,9 @@ class remoting_lib {
 				$this->sys_userid            = $user['userid'];
 				$this->sys_default_group     = $user['default_group'];
 				$this->sys_groups             = $user['groups'];
-				$_SESSION["s"]["user"]["typ"] = $user['typ'];
+				// $_SESSION["s"]["user"]["typ"] = $user['typ'];
+				// we have to force admin priveliges for the remoting API as some function calls might fail otherwise.
+				$_SESSION["s"]["user"]["typ"] = 'admin';
 			}
 
 		return true;
-- 
GitLab