$token = $_POST['token'];
$remote = $_POST['remote'];
$owner = $_POST['owner'];
+$ownerDisplayName = $_POST['ownerDisplayName'];
$name = $_POST['name'];
$password = $_POST['password'];
}
}
-$mount = $externalManager->addShare($remote, $token, $password, $name, $owner, true);
+$mount = $externalManager->addShare($remote, $token, $password, $name, $ownerDisplayName, true);
/**
* @var \OCA\Files_Sharing\External\Storage $storage
*/
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);
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') {
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() {
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) !== '/') {
};
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) {
$shareTmpl = [];
$shareTmpl['displayName'] = User::getDisplayName($shareOwner);
+ $shareTmpl['owner'] = $shareOwner;
$shareTmpl['filename'] = $file;
$shareTmpl['directory_path'] = $linkItem['file_target'];
$shareTmpl['mimetype'] = Filesystem::getMimeType($originalSharePath);
if ($_['server2serversharing']) {
?>
<span id="save" data-protected="<?php p($_['protected']) ?>"
- data-owner="<?php p($_['displayName']) ?>" data-name="<?php p($_['filename']) ?>">
+ data-owner-display-name="<?php p($_['displayName']) ?>" data-owner="<?php p($_['owner']) ?>" data-name="<?php p($_['filename']) ?>">
<button id="save-button"><?php p($l->t('Add to your ownCloud')) ?></button>
<form class="save-form hidden" action="#">
<input type="text" id="remote_address" placeholder="example.com/owncloud"/>
$response = $this->shareController->showShare($this->token);
$sharedTmplParams = array(
'displayName' => $this->user,
+ 'owner' => $this->user,
'filename' => 'file1.txt',
'directory_path' => '/file1.txt',
'mimetype' => 'text/plain',