s/ownCloud/Nextcloud

This commit is contained in:
Bjoern Schiessle 2016-07-12 16:30:09 +02:00
parent 33a685bc41
commit 2f23054b01
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6
6 changed files with 19 additions and 22 deletions

View File

@ -21,6 +21,6 @@
return [
'routes' => [
['name' => 'SaveToOwnCloud#saveToOwnCloud', 'url' => '/saveToOwnCloud', 'verb' => 'POST'],
['name' => 'SaveToNextcloud#saveToNextcloud', 'url' => '/saveToNextcloud', 'verb' => 'POST'],
]
];

View File

@ -32,7 +32,7 @@ use OCP\IRequest;
use OCP\ISession;
use OCP\Share\IManager;
class SaveToOwnCloudController extends Controller {
class SaveToNextcloudController extends Controller {
/** @var FederatedShareProvider */
private $federatedShareProvider;
@ -47,7 +47,7 @@ class SaveToOwnCloudController extends Controller {
private $session;
/**
* SaveToOwnCloudController constructor.
* SaveToNextcloudController constructor.
*
* @param string $appName
* @param IRequest $request
@ -72,7 +72,7 @@ class SaveToOwnCloudController extends Controller {
}
/**
* save public link to my ownCloud by asking the owner to create a federated
* save public link to my Nextcloud by asking the owner to create a federated
* share with me
*
* @NoCSRFRequired
@ -83,7 +83,7 @@ class SaveToOwnCloudController extends Controller {
* @param string $password
* @return JSONResponse
*/
public function saveToOwnCloud($shareWith, $token, $password = '') {
public function saveToNextcloud($shareWith, $token, $password = '') {
try {
list(, $server) = $this->addressHandler->splitUserRemote($shareWith);

View File

@ -24,7 +24,7 @@ namespace OCA\FederatedFileSharing\Tests\Controller;
use OC\HintException;
use OCA\FederatedFileSharing\AddressHandler;
use OCA\FederatedFileSharing\Controller\SaveToOwnCloudController;
use OCA\FederatedFileSharing\Controller\SaveToNextcloudController;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCP\AppFramework\Http;
use OCP\Files\IRootFolder;
@ -34,9 +34,9 @@ use OCP\Share;
use OCP\Share\IManager;
use OCP\Share\IShare;
class SaveToOwnCloudControllerTest extends \Test\TestCase {
class SaveToNextcloudControllerTest extends \Test\TestCase {
/** @var SaveToOwnCloudController */
/** @var SaveToNextcloudController */
private $controller;
/** @var \OCP\IRequest | \PHPUnit_Framework_MockObject_MockObject */
@ -77,7 +77,7 @@ class SaveToOwnCloudControllerTest extends \Test\TestCase {
$this->share = new \OC\Share20\Share($this->rootFolder, $this->userManager);
$this->session = $this->getMock('OCP\ISession');
$this->controller = new SaveToOwnCloudController(
$this->controller = new SaveToNextcloudController(
'federatedfilesharing', $this->request,
$this->federatedShareProvider,
$this->shareManager,
@ -87,7 +87,7 @@ class SaveToOwnCloudControllerTest extends \Test\TestCase {
}
/**
* @dataProvider dataTestSaveToOwnCloud
* @dataProvider dataTestSaveToNextcloud
*
* @param string $shareWith
* @param bool $validShareWith
@ -96,7 +96,7 @@ class SaveToOwnCloudControllerTest extends \Test\TestCase {
* @param bool $createSuccessful
* @param string $expectedReturnData
*/
public function testSaveToOwnCloud($shareWith, $validShareWith, $token, $validToken, $createSuccessful, $expectedReturnData) {
public function testSaveToNextcloud($shareWith, $validShareWith, $token, $validToken, $createSuccessful, $expectedReturnData) {
$this->addressHandler->expects($this->any())->method('splitUserRemote')
->with($shareWith)
->willReturnCallback(
@ -133,7 +133,7 @@ class SaveToOwnCloudControllerTest extends \Test\TestCase {
}
);
$result = $this->controller->saveToOwnCloud($shareWith, $token);
$result = $this->controller->saveToNextcloud($shareWith, $token);
$errorCase = !$validShareWith || !$validToken || !$createSuccessful;
@ -150,7 +150,7 @@ class SaveToOwnCloudControllerTest extends \Test\TestCase {
}
public function dataTestSaveToOwnCloud() {
public function dataTestSaveToNextcloud() {
return [
//shareWith, validShareWith, token, validToken, createSuccessful, expectedReturnData
['user@server', true, 'token', true, true, 'server'],

View File

@ -50,10 +50,8 @@ $shareWith = \OCP\User::getUser() . '@' . $urlGenerator->getAbsoluteURL('/');
$httpClient = \OC::$server->getHTTPClientService()->newClient();
error_log("do th post");
try {
$response = $httpClient->post($remote . '/index.php/apps/federatedfilesharing/saveToOwnCloud',
$response = $httpClient->post($remote . '/index.php/apps/federatedfilesharing/saveToNextcloud',
[
'body' =>
[

View File

@ -99,7 +99,6 @@
var callbackAddShare = function(result, share) {
var password = share.password || '';
if (result) {
//$.post(OC.generateUrl('/apps/files_sharing/api/externalShares'), {id: share.id});
$.post(OC.generateUrl('apps/files_sharing/external'), {
remote: share.remote,
token: share.token,

View File

@ -247,7 +247,7 @@ OCA.Sharing.PublicApp = {
var ownerDisplayName = $('#save').data('owner-display-name');
var name = $('#save').data('name');
var isProtected = $('#save').data('protected') ? 1 : 0;
OCA.Sharing.PublicApp._saveToOwnCloud(remote, token, owner, ownerDisplayName, name, isProtected);
OCA.Sharing.PublicApp._saveToNextcloud(remote, token, owner, ownerDisplayName, name, isProtected);
});
$('#remote_address').on("keyup paste", function() {
@ -307,7 +307,7 @@ OCA.Sharing.PublicApp = {
* @param isProtected
* @private
*/
_legacySaveToOwnCloud: function (remote, token, owner, ownerDisplayName, name, isProtected) {
_legacySaveToNextcloud: function (remote, token, owner, ownerDisplayName, name, isProtected) {
var location = window.location.protocol + '//' + window.location.host + OC.webroot;
@ -335,7 +335,7 @@ OCA.Sharing.PublicApp = {
}
},
_saveToOwnCloud: function (remote, token, owner, ownerDisplayName, name, isProtected) {
_saveToNextcloud: function (remote, token, owner, ownerDisplayName, name, isProtected) {
var toggleLoading = function() {
var iconClass = $('#save-button-confirm').attr('class');
@ -357,13 +357,13 @@ OCA.Sharing.PublicApp = {
toggleLoading();
if (remote.indexOf('@') == -1) {
this._legacySaveToOwnCloud(remote, token, owner, ownerDisplayName, name, isProtected);
this._legacySaveToNextcloud(remote, token, owner, ownerDisplayName, name, isProtected);
toggleLoading();
return;
}
$.post(
OC.generateUrl('/apps/federatedfilesharing/saveToOwnCloud'),
OC.generateUrl('/apps/federatedfilesharing/saveToNextcloud'),
{
'shareWith': remote,
'token': token