From 31b1a73e1f508a33843835b632ee05c7bfc2aaaf Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 14 Jan 2013 19:45:17 +0100 Subject: Check if user is admin - bool There was no "isAdminUser()" function which returned bool. This is irritiating as there were a loooooooot of places in the code which checked this itself with `OC_Group::inGroup($uid, 'admin)` - why not use a function for this? (Especially if you consider that we might change the group name in the future, which would lead to problems then) Additionally, @Raydiation needed such a method for his AppFramework :) --- lib/ocs/cloud.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/ocs') diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php index 21095ec91e9..4564a1e9f1f 100644 --- a/lib/ocs/cloud.php +++ b/lib/ocs/cloud.php @@ -40,7 +40,7 @@ class OC_OCS_Cloud { public static function getUserQuota($parameters) { $user = OC_User::getUser(); - if(OC_Group::inGroup($user, 'admin') or ($user==$parameters['user'])) { + if(OC_User::isAdminUser($user) or ($user==$parameters['user'])) { if(OC_User::userExists($parameters['user'])) { // calculate the disc space @@ -82,7 +82,7 @@ class OC_OCS_Cloud { public static function getUserPrivatekey($parameters) { $user = OC_User::getUser(); - if(OC_Group::inGroup($user, 'admin') or ($user==$parameters['user'])) { + if(OC_User::isAdminUser($user) or ($user==$parameters['user'])) { if(OC_User::userExists($user)) { // calculate the disc space -- cgit v1.2.3