diff options
Diffstat (limited to 'lib/util.php')
-rwxr-xr-x | lib/util.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php index 0c563278cc5..6e62ed9bf58 100755 --- a/lib/util.php +++ b/lib/util.php @@ -66,7 +66,7 @@ class OC_Util { * @return array */ public static function getVersion(){ - return array(4,80,1); + return array(4,81,2); } /** @@ -319,6 +319,23 @@ class OC_Util { } /** + * Check if the user is a subadmin, redirects to home if not + * @return array $groups where the current user is subadmin + */ + public static function checkSubAdminUser(){ + // Check if we are a user + self::checkLoggedIn(); + if(OC_Group::inGroup(OC_User::getUser(),'admin')){ + return true; + } + if(!OC_SubAdmin::isSubAdmin(OC_User::getUser())){ + header( 'Location: '.OC_Helper::linkToAbsolute( '', 'index.php' )); + exit(); + } + return true; + } + + /** * Redirect to the user default page */ public static function redirectToDefaultPage(){ |