API: Use OC_API::checkLoggedIn() and OAuth scopes are app_$appname
This commit is contained in:
parent
395a056b64
commit
88c6928bad
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue