API: Use OC_API::checkLoggedIn() and OAuth scopes are app_$appname

This commit is contained in:
Tom Needham 2012-08-03 11:36:01 +00:00
parent 395a056b64
commit 88c6928bad
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}