summaryrefslogtreecommitdiffstats
path: root/lib/private/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/util.php')
-rw-r--r--lib/private/util.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index 0b6cfb099d1..41f3c26e405 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -1025,7 +1025,13 @@ class OC_Util {
*/
public static function checkSubAdminUser() {
OC_Util::checkLoggedIn();
- if (!OC_SubAdmin::isSubAdmin(OC_User::getUser())) {
+ $userObject = \OC::$server->getUserSession()->getUser();
+ $isSubAdmin = false;
+ if($userObject !== null) {
+ $isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject);
+ }
+
+ if (!$isSubAdmin) {
header('Location: ' . OC_Helper::linkToAbsolute('', 'index.php'));
exit();
}