From 88c6928bade99676ab44dd43519dd40d470515c6 Mon Sep 17 00:00:00 2001 From: Tom Needham <needham.thomas@gmail.com> Date: Fri, 3 Aug 2012 11:36:01 +0000 Subject: [PATCH] API: Use OC_API::checkLoggedIn() and OAuth scopes are app_$appname --- settings/oauth.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/settings/oauth.php b/settings/oauth.php index 9e7a3c0493..b04c798b1b 100644 --- a/settings/oauth.php +++ b/settings/oauth.php @@ -27,7 +27,7 @@ switch($operation){ } break; case 'authorise'; - OC_Util::checkLoggedIn(); + OC_API::checkLoggedIn(); // Example $consumer = array( 'name' => 'Firefox Bookmark Sync', @@ -38,6 +38,8 @@ switch($operation){ $apps = OC_App::getEnabledApps(); $notfound = array(); foreach($consumer['scopes'] as $requiredapp){ + // App scopes are in this format: app_$appname + $requiredapp = end(explode('_', $requiredapp)); if(!in_array($requiredapp, $apps)){ $notfound[] = $requiredapp; } -- GitLab