Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/impersonate.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-04-17 23:59:56 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2018-04-18 00:02:59 +0300
commit6810c2bf62c0f9126f98d66b45ed2b5d1b8231b0 (patch)
tree0a882abf0201a67eb783cb6d8fb819873b30d0fe /appinfo
parentb8f953f18e4309c6c75a93f66ffd2c17e28646da (diff)
load impersonate script when no restrictions apply
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/app.php10
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');
}
}