diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-04-17 23:59:56 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-04-18 00:02:59 +0300 |
commit | 6810c2bf62c0f9126f98d66b45ed2b5d1b8231b0 (patch) | |
tree | 0a882abf0201a67eb783cb6d8fb819873b30d0fe | |
parent | b8f953f18e4309c6c75a93f66ffd2c17e28646da (diff) |
load impersonate script when no restrictions apply
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | appinfo/app.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index cc62bb6..6b5bce0 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -18,9 +18,15 @@ $eventDispatcher->addListener( 'OC\Settings\Users::loadAdditionalScripts', function() { $authorized = json_decode(\OC::$server->getConfig()->getAppValue('impersonate', 'authorized', '["admin"]')); - $userGroups = \OC::$server->getGroupManager()->getUserGroupIds(\OC::$server->getUserSession()->getUser()); - if (array_intersect($userGroups, $authorized)) { + $loadScript = true; + if(!empty($authorized)) { + $userGroups = \OC::$server->getGroupManager()->getUserGroupIds(\OC::$server->getUserSession()->getUser()); + if (!array_intersect($userGroups, $authorized)) { + $loadScript = false; + } + } + if($loadScript){ \OCP\Util::addScript('impersonate', 'impersonate'); } } |