summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-08-03 11:36:01 +0000
committerTom Needham <needham.thomas@gmail.com>2012-08-03 11:36:01 +0000
commit88c6928bade99676ab44dd43519dd40d470515c6 (patch)
treef1407cb8d7d838c65f8686bbc7dff261836eaa7d /settings
parent395a056b648ad1513a7445617200db53b784ffb6 (diff)
downloadnextcloud-server-88c6928bade99676ab44dd43519dd40d470515c6.tar.gz
nextcloud-server-88c6928bade99676ab44dd43519dd40d470515c6.zip
API: Use OC_API::checkLoggedIn() and OAuth scopes are app_$appname
Diffstat (limited to 'settings')
-rw-r--r--settings/oauth.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/settings/oauth.php b/settings/oauth.php
index 9e7a3c04935..b04c798b1b0 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;
}