diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-15 13:18:04 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-15 13:18:04 +0100 |
commit | 67263ef8b4b01ccf014ebffd48a3deab466878cf (patch) | |
tree | c2cd09969eb919eff435c28d204d0c9e5f055590 /apps/files_sharing/js | |
parent | de813c1025e72bef2633654f2fb77b4d5da72d05 (diff) | |
parent | 1d37e7abfc8316be8f197eb250d04fbf80299a72 (diff) | |
download | nextcloud-server-67263ef8b4b01ccf014ebffd48a3deab466878cf.tar.gz nextcloud-server-67263ef8b4b01ccf014ebffd48a3deab466878cf.zip |
Merge pull request #21067 from owncloud/fix_20296
don't allow to create a federated share if source and target are the same
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/external.js | 3 | ||||
-rw-r--r-- | apps/files_sharing/js/public.js | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_sharing/js/external.js b/apps/files_sharing/js/external.js index f658de307ab..45a6ef02758 100644 --- a/apps/files_sharing/js/external.js +++ b/apps/files_sharing/js/external.js @@ -19,7 +19,7 @@ */ OCA.Sharing.showAddExternalDialog = function (share, passwordProtected, callback) { var remote = share.remote; - var owner = share.owner; + var owner = share.ownerDisplayName || share.owner; var name = share.name; var remoteClean = (remote.substr(0, 8) === 'https://') ? remote.substr(8) : remote.substr(7); @@ -92,6 +92,7 @@ remote: share.remote, token: share.token, owner: share.owner, + ownerDisplayName: share.ownerDisplayName || share.owner, name: share.name, password: password}, function(result) { if (result.status === 'error') { diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 70c1ba5c0c2..af808447381 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -242,9 +242,10 @@ OCA.Sharing.PublicApp = { var remote = $(this).find('input[type="text"]').val(); var token = $('#sharingToken').val(); var owner = $('#save').data('owner'); + 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, name, isProtected); + OCA.Sharing.PublicApp._saveToOwnCloud(remote, token, owner, ownerDisplayName, name, isProtected); }); $('#remote_address').on("keyup paste", function() { @@ -291,7 +292,7 @@ OCA.Sharing.PublicApp = { this.fileList.changeDirectory(params.path || params.dir, false, true); }, - _saveToOwnCloud: function (remote, token, owner, name, isProtected) { + _saveToOwnCloud: function (remote, token, owner, ownerDisplayName, name, isProtected) { var location = window.location.protocol + '//' + window.location.host + OC.webroot; if(remote.substr(-1) !== '/') { @@ -299,7 +300,7 @@ OCA.Sharing.PublicApp = { }; var url = remote + 'index.php/apps/files#' + 'remote=' + encodeURIComponent(location) // our location is the remote for the other server - + "&token=" + encodeURIComponent(token) + "&owner=" + encodeURIComponent(owner) + "&name=" + encodeURIComponent(name) + "&protected=" + isProtected; + + "&token=" + encodeURIComponent(token) + "&owner=" + encodeURIComponent(owner) +"&ownerDisplayName=" + encodeURIComponent(ownerDisplayName) + "&name=" + encodeURIComponent(name) + "&protected=" + isProtected; if (remote.indexOf('://') > 0) { |