Fix usage of deprecated private constants
This commit is contained in:
parent
6ce1abfa5c
commit
3f3f8c2f99
|
@ -85,4 +85,4 @@ $this->create('download', 'download{file}')
|
||||||
->actionInclude('files/download.php');
|
->actionInclude('files/download.php');
|
||||||
|
|
||||||
// Register with the capabilities API
|
// Register with the capabilities API
|
||||||
\OC_API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', \OC_API::USER_AUTH);
|
\OCP\API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', \OCP\API::USER_AUTH);
|
||||||
|
|
|
@ -61,7 +61,7 @@ $this->create('files_external_google', 'ajax/google.php')
|
||||||
$this->create('files_external_list_applicable', '/applicable')
|
$this->create('files_external_list_applicable', '/applicable')
|
||||||
->actionInclude('files_external/ajax/applicable.php');
|
->actionInclude('files_external/ajax/applicable.php');
|
||||||
|
|
||||||
\OC_API::register('get',
|
\OCP\API::register('get',
|
||||||
'/apps/files_external/api/v1/mounts',
|
'/apps/files_external/api/v1/mounts',
|
||||||
array('\OCA\Files\External\Api', 'getUserMounts'),
|
array('\OCA\Files\External\Api', 'getUserMounts'),
|
||||||
'files_external');
|
'files_external');
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
namespace OCA\Files_Sharing\AppInfo;
|
namespace OCA\Files_Sharing\AppInfo;
|
||||||
|
|
||||||
use OCA\Files_Sharing\Application;
|
use OCA\Files_Sharing\Application;
|
||||||
|
use OCP\API;
|
||||||
|
|
||||||
$application = new Application();
|
$application = new Application();
|
||||||
$application->registerRoutes($this, [
|
$application->registerRoutes($this, [
|
||||||
|
@ -55,33 +56,33 @@ $this->create('sharing_external_test_remote', '/testremote')
|
||||||
|
|
||||||
//TODO: SET: mail notification, waiting for PR #4689 to be accepted
|
//TODO: SET: mail notification, waiting for PR #4689 to be accepted
|
||||||
|
|
||||||
\OC_API::register('get',
|
API::register('get',
|
||||||
'/apps/files_sharing/api/v1/shares',
|
'/apps/files_sharing/api/v1/shares',
|
||||||
array('\OCA\Files_Sharing\API\Local', 'getAllShares'),
|
array('\OCA\Files_Sharing\API\Local', 'getAllShares'),
|
||||||
'files_sharing');
|
'files_sharing');
|
||||||
|
|
||||||
\OC_API::register('post',
|
API::register('post',
|
||||||
'/apps/files_sharing/api/v1/shares',
|
'/apps/files_sharing/api/v1/shares',
|
||||||
array('\OCA\Files_Sharing\API\Local', 'createShare'),
|
array('\OCA\Files_Sharing\API\Local', 'createShare'),
|
||||||
'files_sharing');
|
'files_sharing');
|
||||||
|
|
||||||
\OC_API::register('get',
|
API::register('get',
|
||||||
'/apps/files_sharing/api/v1/shares/{id}',
|
'/apps/files_sharing/api/v1/shares/{id}',
|
||||||
array('\OCA\Files_Sharing\API\Local', 'getShare'),
|
array('\OCA\Files_Sharing\API\Local', 'getShare'),
|
||||||
'files_sharing');
|
'files_sharing');
|
||||||
|
|
||||||
\OC_API::register('put',
|
API::register('put',
|
||||||
'/apps/files_sharing/api/v1/shares/{id}',
|
'/apps/files_sharing/api/v1/shares/{id}',
|
||||||
array('\OCA\Files_Sharing\API\Local', 'updateShare'),
|
array('\OCA\Files_Sharing\API\Local', 'updateShare'),
|
||||||
'files_sharing');
|
'files_sharing');
|
||||||
|
|
||||||
\OC_API::register('delete',
|
API::register('delete',
|
||||||
'/apps/files_sharing/api/v1/shares/{id}',
|
'/apps/files_sharing/api/v1/shares/{id}',
|
||||||
array('\OCA\Files_Sharing\API\Local', 'deleteShare'),
|
array('\OCA\Files_Sharing\API\Local', 'deleteShare'),
|
||||||
'files_sharing');
|
'files_sharing');
|
||||||
|
|
||||||
// Register with the capabilities API
|
// Register with the capabilities API
|
||||||
\OC_API::register('get',
|
API::register('get',
|
||||||
'/cloud/capabilities',
|
'/cloud/capabilities',
|
||||||
array('OCA\Files_Sharing\Capabilities', 'getCapabilities'),
|
array('OCA\Files_Sharing\Capabilities', 'getCapabilities'),
|
||||||
'files_sharing', \OC_API::USER_AUTH);
|
'files_sharing', API::USER_AUTH);
|
||||||
|
|
|
@ -34,4 +34,4 @@ $this->create('files_trashbin_ajax_undelete', 'ajax/undelete.php')
|
||||||
|
|
||||||
|
|
||||||
// Register with the capabilities API
|
// Register with the capabilities API
|
||||||
\OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Trashbin\Capabilities', 'getCapabilities'), 'files_trashbin', \OC_API::USER_AUTH);
|
\OCP\API::register('get', '/cloud/capabilities', array('OCA\Files_Trashbin\Capabilities', 'getCapabilities'), 'files_trashbin', \OCP\API::USER_AUTH);
|
||||||
|
|
|
@ -38,4 +38,4 @@ $this->create('files_versions_ajax_rollbackVersion', 'ajax/rollbackVersion.php')
|
||||||
->actionInclude('files_versions/ajax/rollbackVersion.php');
|
->actionInclude('files_versions/ajax/rollbackVersion.php');
|
||||||
|
|
||||||
// Register with the capabilities API
|
// Register with the capabilities API
|
||||||
OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH);
|
\OCP\API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', \OCP\API::USER_AUTH);
|
||||||
|
|
|
@ -21,27 +21,29 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Users
|
// Users
|
||||||
OCP\API::register('get', '/cloud/users', array('OCA\Provisioning_API\Users', 'getUsers'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
use OCP\API;
|
||||||
OCP\API::register('post', '/cloud/users', array('OCA\Provisioning_API\Users', 'addUser'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
|
||||||
OCP\API::register('get', '/cloud/users/{userid}', array('OCA\Provisioning_API\Users', 'getUser'), 'provisioning_api', OC_API::USER_AUTH);
|
API::register('get', '/cloud/users', array('OCA\Provisioning_API\Users', 'getUsers'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
OCP\API::register('put', '/cloud/users/{userid}', array('OCA\Provisioning_API\Users', 'editUser'), 'provisioning_api', OC_API::USER_AUTH);
|
API::register('post', '/cloud/users', array('OCA\Provisioning_API\Users', 'addUser'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
OCP\API::register('delete', '/cloud/users/{userid}', array('OCA\Provisioning_API\Users', 'deleteUser'), 'provisioning_api', OC_API::SUBADMIN_AUTH);
|
API::register('get', '/cloud/users/{userid}', array('OCA\Provisioning_API\Users', 'getUser'), 'provisioning_api', API::USER_AUTH);
|
||||||
OCP\API::register('get', '/cloud/users/{userid}/groups', array('OCA\Provisioning_API\Users', 'getUsersGroups'), 'provisioning_api', OC_API::USER_AUTH);
|
API::register('put', '/cloud/users/{userid}', array('OCA\Provisioning_API\Users', 'editUser'), 'provisioning_api', API::USER_AUTH);
|
||||||
OCP\API::register('post', '/cloud/users/{userid}/groups', array('OCA\Provisioning_API\Users', 'addToGroup'), 'provisioning_api', OC_API::SUBADMIN_AUTH);
|
API::register('delete', '/cloud/users/{userid}', array('OCA\Provisioning_API\Users', 'deleteUser'), 'provisioning_api', API::SUBADMIN_AUTH);
|
||||||
OCP\API::register('delete', '/cloud/users/{userid}/groups', array('OCA\Provisioning_API\Users', 'removeFromGroup'), 'provisioning_api', OC_API::SUBADMIN_AUTH);
|
API::register('get', '/cloud/users/{userid}/groups', array('OCA\Provisioning_API\Users', 'getUsersGroups'), 'provisioning_api', API::USER_AUTH);
|
||||||
OCP\API::register('post', '/cloud/users/{userid}/subadmins', array('OCA\Provisioning_API\Users', 'addSubAdmin'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
API::register('post', '/cloud/users/{userid}/groups', array('OCA\Provisioning_API\Users', 'addToGroup'), 'provisioning_api', API::SUBADMIN_AUTH);
|
||||||
OCP\API::register('delete', '/cloud/users/{userid}/subadmins', array('OCA\Provisioning_API\Users', 'removeSubAdmin'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
API::register('delete', '/cloud/users/{userid}/groups', array('OCA\Provisioning_API\Users', 'removeFromGroup'), 'provisioning_api', API::SUBADMIN_AUTH);
|
||||||
OCP\API::register('get', '/cloud/users/{userid}/subadmins', array('OCA\Provisioning_API\Users', 'getUserSubAdminGroups'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
API::register('post', '/cloud/users/{userid}/subadmins', array('OCA\Provisioning_API\Users', 'addSubAdmin'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
|
API::register('delete', '/cloud/users/{userid}/subadmins', array('OCA\Provisioning_API\Users', 'removeSubAdmin'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
|
API::register('get', '/cloud/users/{userid}/subadmins', array('OCA\Provisioning_API\Users', 'getUserSubAdminGroups'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
|
|
||||||
// Groups
|
// Groups
|
||||||
OCP\API::register('get', '/cloud/groups', array('OCA\Provisioning_API\Groups', 'getGroups'), 'provisioning_api', OC_API::SUBADMIN_AUTH);
|
API::register('get', '/cloud/groups', array('OCA\Provisioning_API\Groups', 'getGroups'), 'provisioning_api', API::SUBADMIN_AUTH);
|
||||||
OCP\API::register('post', '/cloud/groups', array('OCA\Provisioning_API\Groups', 'addGroup'), 'provisioning_api', OC_API::SUBADMIN_AUTH);
|
API::register('post', '/cloud/groups', array('OCA\Provisioning_API\Groups', 'addGroup'), 'provisioning_api', API::SUBADMIN_AUTH);
|
||||||
OCP\API::register('get', '/cloud/groups/{groupid}', array('OCA\Provisioning_API\Groups', 'getGroup'), 'provisioning_api', OC_API::SUBADMIN_AUTH);
|
API::register('get', '/cloud/groups/{groupid}', array('OCA\Provisioning_API\Groups', 'getGroup'), 'provisioning_api', API::SUBADMIN_AUTH);
|
||||||
OCP\API::register('delete', '/cloud/groups/{groupid}', array('OCA\Provisioning_API\Groups', 'deleteGroup'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
API::register('delete', '/cloud/groups/{groupid}', array('OCA\Provisioning_API\Groups', 'deleteGroup'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
OCP\API::register('get', '/cloud/groups/{groupid}/subadmins', array('OCA\Provisioning_API\Groups', 'getSubAdminsOfGroup'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
API::register('get', '/cloud/groups/{groupid}/subadmins', array('OCA\Provisioning_API\Groups', 'getSubAdminsOfGroup'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
|
|
||||||
// Apps
|
// Apps
|
||||||
OCP\API::register('get', '/cloud/apps', array('OCA\Provisioning_API\Apps', 'getApps'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
API::register('get', '/cloud/apps', array('OCA\Provisioning_API\Apps', 'getApps'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
OCP\API::register('get', '/cloud/apps/{appid}', array('OCA\Provisioning_API\Apps', 'getAppInfo'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
API::register('get', '/cloud/apps/{appid}', array('OCA\Provisioning_API\Apps', 'getAppInfo'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
OCP\API::register('post', '/cloud/apps/{appid}', array('OCA\Provisioning_API\Apps', 'enable'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
API::register('post', '/cloud/apps/{appid}', array('OCA\Provisioning_API\Apps', 'enable'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
OCP\API::register('delete', '/cloud/apps/{appid}', array('OCA\Provisioning_API\Apps', 'disable'), 'provisioning_api', OC_API::ADMIN_AUTH);
|
API::register('delete', '/cloud/apps/{appid}', array('OCA\Provisioning_API\Apps', 'disable'), 'provisioning_api', API::ADMIN_AUTH);
|
||||||
|
|
|
@ -60,7 +60,7 @@ class Apps {
|
||||||
if(!is_null($info)) {
|
if(!is_null($info)) {
|
||||||
return new OC_OCS_Result(OC_App::getAppInfo($app));
|
return new OC_OCS_Result(OC_App::getAppInfo($app));
|
||||||
} else {
|
} else {
|
||||||
return new OC_OCS_Result(null, \OC_API::RESPOND_NOT_FOUND, 'The request app was not found');
|
return new OC_OCS_Result(null, \OCP\API::RESPOND_NOT_FOUND, 'The request app was not found');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,14 +44,14 @@ class Groups{
|
||||||
public static function getGroup($parameters){
|
public static function getGroup($parameters){
|
||||||
// Check the group exists
|
// Check the group exists
|
||||||
if(!OC_Group::groupExists($parameters['groupid'])){
|
if(!OC_Group::groupExists($parameters['groupid'])){
|
||||||
return new OC_OCS_Result(null, \OC_API::RESPOND_NOT_FOUND, 'The requested group could not be found');
|
return new OC_OCS_Result(null, \OCP\API::RESPOND_NOT_FOUND, 'The requested group could not be found');
|
||||||
}
|
}
|
||||||
// Check subadmin has access to this group
|
// Check subadmin has access to this group
|
||||||
if(\OC_User::isAdminUser(\OC_User::getUser())
|
if(\OC_User::isAdminUser(\OC_User::getUser())
|
||||||
|| in_array($parameters['groupid'], \OC_SubAdmin::getSubAdminsGroups(\OC_User::getUser()))){
|
|| in_array($parameters['groupid'], \OC_SubAdmin::getSubAdminsGroups(\OC_User::getUser()))){
|
||||||
return new OC_OCS_Result(array('users' => OC_Group::usersInGroup($parameters['groupid'])));
|
return new OC_OCS_Result(array('users' => OC_Group::usersInGroup($parameters['groupid'])));
|
||||||
} else {
|
} else {
|
||||||
return new OC_OCS_Result(null, \OC_API::RESPOND_UNAUTHORISED, 'User does not have access to specified group');
|
return new OC_OCS_Result(null, \OCP\API::RESPOND_UNAUTHORISED, 'User does not have access to specified group');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ class Users {
|
||||||
if(OC_User::isAdminUser(OC_User::getUser()) || OC_SubAdmin::isUserAccessible(OC_User::getUser(), $userId)) {
|
if(OC_User::isAdminUser(OC_User::getUser()) || OC_SubAdmin::isUserAccessible(OC_User::getUser(), $userId)) {
|
||||||
// Check they exist
|
// Check they exist
|
||||||
if(!OC_User::userExists($userId)) {
|
if(!OC_User::userExists($userId)) {
|
||||||
return new OC_OCS_Result(null, \OC_API::RESPOND_NOT_FOUND, 'The requested user could not be found');
|
return new OC_OCS_Result(null, \OCP\API::RESPOND_NOT_FOUND, 'The requested user could not be found');
|
||||||
}
|
}
|
||||||
// Show all
|
// Show all
|
||||||
$return = array(
|
$return = array(
|
||||||
|
@ -80,7 +80,7 @@ class Users {
|
||||||
} else {
|
} else {
|
||||||
// Check they are looking up themselves
|
// Check they are looking up themselves
|
||||||
if(OC_User::getUser() != $userId) {
|
if(OC_User::getUser() != $userId) {
|
||||||
return new OC_OCS_Result(null, \OC_API::RESPOND_UNAUTHORISED);
|
return new OC_OCS_Result(null, \OCP\API::RESPOND_UNAUTHORISED);
|
||||||
}
|
}
|
||||||
// Return some additional information compared to the core route
|
// Return some additional information compared to the core route
|
||||||
$return = array(
|
$return = array(
|
||||||
|
@ -226,7 +226,7 @@ class Users {
|
||||||
// Check they're an admin
|
// Check they're an admin
|
||||||
if(!OC_Group::inGroup(OC_User::getUser(), 'admin')){
|
if(!OC_Group::inGroup(OC_User::getUser(), 'admin')){
|
||||||
// This user doesn't have rights to add a user to this group
|
// This user doesn't have rights to add a user to this group
|
||||||
return new OC_OCS_Result(null, \OC_API::RESPOND_UNAUTHORISED);
|
return new OC_OCS_Result(null, \OCP\API::RESPOND_UNAUTHORISED);
|
||||||
}
|
}
|
||||||
// Check if the group exists
|
// Check if the group exists
|
||||||
if(!OC_Group::groupExists($group)){
|
if(!OC_Group::groupExists($group)){
|
||||||
|
|
|
@ -36,7 +36,7 @@ class AppsTest extends TestCase {
|
||||||
$result = \OCA\provisioning_API\Apps::getAppInfo(array('appid' => 'not_provisioning_api'));
|
$result = \OCA\provisioning_API\Apps::getAppInfo(array('appid' => 'not_provisioning_api'));
|
||||||
$this->assertInstanceOf('OC_OCS_Result', $result);
|
$this->assertInstanceOf('OC_OCS_Result', $result);
|
||||||
$this->assertFalse($result->succeeded());
|
$this->assertFalse($result->succeeded());
|
||||||
$this->assertEquals(\OC_API::RESPOND_NOT_FOUND, $result->getStatusCode());
|
$this->assertEquals(\OCP\API::RESPOND_NOT_FOUND, $result->getStatusCode());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ class GroupsTest extends TestCase {
|
||||||
|
|
||||||
$this->assertInstanceOf('OC_OCS_Result', $result);
|
$this->assertInstanceOf('OC_OCS_Result', $result);
|
||||||
$this->assertFalse($result->succeeded());
|
$this->assertFalse($result->succeeded());
|
||||||
$this->assertEquals(\OC_API::RESPOND_UNAUTHORISED, $result->getStatusCode());
|
$this->assertEquals(\OCP\API::RESPOND_UNAUTHORISED, $result->getStatusCode());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ class GroupsTest extends TestCase {
|
||||||
|
|
||||||
$this->assertInstanceOf('OC_OCS_Result', $result);
|
$this->assertInstanceOf('OC_OCS_Result', $result);
|
||||||
$this->assertFalse($result->succeeded());
|
$this->assertFalse($result->succeeded());
|
||||||
$this->assertEquals(\OC_API::RESPOND_UNAUTHORISED, $result->getStatusCode());
|
$this->assertEquals(\OCP\API::RESPOND_UNAUTHORISED, $result->getStatusCode());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ class UsersTest extends TestCase {
|
||||||
$result = \OCA\provisioning_API\Users::getUser($params);
|
$result = \OCA\provisioning_API\Users::getUser($params);
|
||||||
$this->assertInstanceOf('OC_OCS_Result', $result);
|
$this->assertInstanceOf('OC_OCS_Result', $result);
|
||||||
$this->assertFalse($result->succeeded());
|
$this->assertFalse($result->succeeded());
|
||||||
$this->assertEquals(\OC_API::RESPOND_NOT_FOUND, $result->getStatusCode());
|
$this->assertEquals(\OCP\API::RESPOND_NOT_FOUND, $result->getStatusCode());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ class OC_API {
|
||||||
// Which shipped response do we use if they all failed?
|
// Which shipped response do we use if they all failed?
|
||||||
// They may have failed for different reasons (different status codes)
|
// They may have failed for different reasons (different status codes)
|
||||||
// Which response code should we return?
|
// Which response code should we return?
|
||||||
// Maybe any that are not OC_API::RESPOND_SERVER_ERROR
|
// Maybe any that are not \OCP\API::RESPOND_SERVER_ERROR
|
||||||
// Merge failed responses if more than one
|
// Merge failed responses if more than one
|
||||||
$data = array();
|
$data = array();
|
||||||
foreach($shipped['failed'] as $failure) {
|
foreach($shipped['failed'] as $failure) {
|
||||||
|
@ -400,7 +400,7 @@ class OC_API {
|
||||||
* Based on the requested format the response content type is set
|
* Based on the requested format the response content type is set
|
||||||
*/
|
*/
|
||||||
public static function setContentType() {
|
public static function setContentType() {
|
||||||
$format = \OC_API::requestedFormat();
|
$format = self::requestedFormat();
|
||||||
if ($format === 'xml') {
|
if ($format === 'xml') {
|
||||||
header('Content-type: text/xml; charset=UTF-8');
|
header('Content-type: text/xml; charset=UTF-8');
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -23,109 +23,111 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use OCP\API;
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
OC_API::register(
|
API::register(
|
||||||
'get',
|
'get',
|
||||||
'/config',
|
'/config',
|
||||||
array('OC_OCS_Config', 'apiConfig'),
|
array('OC_OCS_Config', 'apiConfig'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::GUEST_AUTH
|
API::GUEST_AUTH
|
||||||
);
|
);
|
||||||
// Person
|
// Person
|
||||||
OC_API::register(
|
API::register(
|
||||||
'post',
|
'post',
|
||||||
'/person/check',
|
'/person/check',
|
||||||
array('OC_OCS_Person', 'check'),
|
array('OC_OCS_Person', 'check'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::GUEST_AUTH
|
API::GUEST_AUTH
|
||||||
);
|
);
|
||||||
// Privatedata
|
// Privatedata
|
||||||
OC_API::register(
|
API::register(
|
||||||
'get',
|
'get',
|
||||||
'/privatedata/getattribute',
|
'/privatedata/getattribute',
|
||||||
array('OC_OCS_Privatedata', 'get'),
|
array('OC_OCS_Privatedata', 'get'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::USER_AUTH,
|
API::USER_AUTH,
|
||||||
array('app' => '', 'key' => '')
|
array('app' => '', 'key' => '')
|
||||||
);
|
);
|
||||||
OC_API::register(
|
API::register(
|
||||||
'get',
|
'get',
|
||||||
'/privatedata/getattribute/{app}',
|
'/privatedata/getattribute/{app}',
|
||||||
array('OC_OCS_Privatedata', 'get'),
|
array('OC_OCS_Privatedata', 'get'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::USER_AUTH,
|
API::USER_AUTH,
|
||||||
array('key' => '')
|
array('key' => '')
|
||||||
);
|
);
|
||||||
OC_API::register(
|
API::register(
|
||||||
'get',
|
'get',
|
||||||
'/privatedata/getattribute/{app}/{key}',
|
'/privatedata/getattribute/{app}/{key}',
|
||||||
array('OC_OCS_Privatedata', 'get'),
|
array('OC_OCS_Privatedata', 'get'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::USER_AUTH
|
API::USER_AUTH
|
||||||
);
|
);
|
||||||
OC_API::register(
|
API::register(
|
||||||
'post',
|
'post',
|
||||||
'/privatedata/setattribute/{app}/{key}',
|
'/privatedata/setattribute/{app}/{key}',
|
||||||
array('OC_OCS_Privatedata', 'set'),
|
array('OC_OCS_Privatedata', 'set'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::USER_AUTH
|
API::USER_AUTH
|
||||||
);
|
);
|
||||||
OC_API::register(
|
API::register(
|
||||||
'post',
|
'post',
|
||||||
'/privatedata/deleteattribute/{app}/{key}',
|
'/privatedata/deleteattribute/{app}/{key}',
|
||||||
array('OC_OCS_Privatedata', 'delete'),
|
array('OC_OCS_Privatedata', 'delete'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::USER_AUTH
|
API::USER_AUTH
|
||||||
);
|
);
|
||||||
// cloud
|
// cloud
|
||||||
OC_API::register(
|
API::register(
|
||||||
'get',
|
'get',
|
||||||
'/cloud/capabilities',
|
'/cloud/capabilities',
|
||||||
array('OC_OCS_Cloud', 'getCapabilities'),
|
array('OC_OCS_Cloud', 'getCapabilities'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::USER_AUTH
|
API::USER_AUTH
|
||||||
);
|
);
|
||||||
OC_API::register(
|
API::register(
|
||||||
'get',
|
'get',
|
||||||
'/cloud/users/{userid}',
|
'/cloud/users/{userid}',
|
||||||
array('OC_OCS_Cloud', 'getUser'),
|
array('OC_OCS_Cloud', 'getUser'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::USER_AUTH
|
API::USER_AUTH
|
||||||
);
|
);
|
||||||
OC_API::register(
|
API::register(
|
||||||
'get',
|
'get',
|
||||||
'/cloud/user',
|
'/cloud/user',
|
||||||
array('OC_OCS_Cloud', 'getCurrentUser'),
|
array('OC_OCS_Cloud', 'getCurrentUser'),
|
||||||
'core',
|
'core',
|
||||||
OC_API::USER_AUTH
|
API::USER_AUTH
|
||||||
);
|
);
|
||||||
|
|
||||||
// Server-to-Server Sharing
|
// Server-to-Server Sharing
|
||||||
$s2s = new \OCA\Files_Sharing\API\Server2Server();
|
$s2s = new \OCA\Files_Sharing\API\Server2Server();
|
||||||
OC_API::register('post',
|
API::register('post',
|
||||||
'/cloud/shares',
|
'/cloud/shares',
|
||||||
array($s2s, 'createShare'),
|
array($s2s, 'createShare'),
|
||||||
'files_sharing',
|
'files_sharing',
|
||||||
OC_API::GUEST_AUTH
|
API::GUEST_AUTH
|
||||||
);
|
);
|
||||||
|
|
||||||
OC_API::register('post',
|
API::register('post',
|
||||||
'/cloud/shares/{id}/accept',
|
'/cloud/shares/{id}/accept',
|
||||||
array($s2s, 'acceptShare'),
|
array($s2s, 'acceptShare'),
|
||||||
'files_sharing',
|
'files_sharing',
|
||||||
OC_API::GUEST_AUTH
|
API::GUEST_AUTH
|
||||||
);
|
);
|
||||||
|
|
||||||
OC_API::register('post',
|
API::register('post',
|
||||||
'/cloud/shares/{id}/decline',
|
'/cloud/shares/{id}/decline',
|
||||||
array($s2s, 'declineShare'),
|
array($s2s, 'declineShare'),
|
||||||
'files_sharing',
|
'files_sharing',
|
||||||
OC_API::GUEST_AUTH
|
API::GUEST_AUTH
|
||||||
);
|
);
|
||||||
|
|
||||||
OC_API::register('post',
|
API::register('post',
|
||||||
'/cloud/shares/{id}/unshare',
|
'/cloud/shares/{id}/unshare',
|
||||||
array($s2s, 'unshare'),
|
array($s2s, 'unshare'),
|
||||||
'files_sharing',
|
'files_sharing',
|
||||||
OC_API::GUEST_AUTH
|
API::GUEST_AUTH
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue