aboutsummaryrefslogtreecommitdiffstats
path: root/lib/json.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-07-31 15:00:04 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-07-31 15:00:04 -0400
commit94ce8f2168bdd9897f54ec433ad7017fb3db1cc8 (patch)
treedb031ac7fd4788be6593e258d170c8f134533e4b /lib/json.php
parent269922543eaf9e69dbf5a15fa0ba34704040b09c (diff)
parentdfae77dec1650f171d09d4bde88ab74029f6e8c7 (diff)
downloadnextcloud-server-94ce8f2168bdd9897f54ec433ad7017fb3db1cc8.tar.gz
nextcloud-server-94ce8f2168bdd9897f54ec433ad7017fb3db1cc8.zip
Merge branch 'master' into share_api
Conflicts: apps/contacts/lib/app.php apps/files_sharing/js/share.js
Diffstat (limited to 'lib/json.php')
-rw-r--r--lib/json.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/json.php b/lib/json.php
index b46878375d5..3d9d5c96fa3 100644
--- a/lib/json.php
+++ b/lib/json.php
@@ -64,6 +64,18 @@ class OC_JSON{
exit();
}
}
+
+ /**
+ * Check if the user is a subadmin, send json error msg if not
+ */
+ public static function checkSubAdminUser(){
+ self::checkLoggedIn();
+ if(!OC_Group::inGroup(OC_User::getUser(),'admin') && !OC_SubAdmin::isSubAdmin(OC_User::getUser())){
+ $l = OC_L10N::get('core');
+ self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
+ exit();
+ }
+ }
/**
* Send json error msg