Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Adding owner to the remote share alert box
Browse files Browse the repository at this point in the history
  • Loading branch information
ghecquet committed Mar 10, 2016
1 parent df43929 commit 4965331
Show file tree
Hide file tree
Showing 30 changed files with 71 additions and 32 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/ca.php
Expand Up @@ -641,7 +641,7 @@
"543" => "Resultats limitats a 100 de %s.",
"544" => "Mostrar tot",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
);
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/cs.php
Expand Up @@ -639,7 +639,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
);
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/da.php
Expand Up @@ -642,7 +642,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/de.php
Expand Up @@ -646,7 +646,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
);
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/en.php
Expand Up @@ -639,7 +639,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
);
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/es.php
Expand Up @@ -644,7 +644,7 @@
"543" => "Resultados limitados a 100 de %s.",
"544" => "Mostrar todo",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
);
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/et.php
Expand Up @@ -640,7 +640,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/eus.php
Expand Up @@ -638,7 +638,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/fi.php
Expand Up @@ -640,7 +640,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/fr.php
Expand Up @@ -639,7 +639,7 @@
"543" => "Résultats limités au 100 premiers sur %s.",
"544" => "Voir tout",
"545" => "Partage à distance",
"546" => "Cet item provient d'un système distant. Souhaîtez-vous continuer ?",
"546" => "Cet item provient de %%OWNER%% d'un système distant. Souhaîtez-vous continuer ?",
"547" => "Accepter",
"548" => "Refuser"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/gr.php
Expand Up @@ -637,7 +637,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/he.php
Expand Up @@ -637,7 +637,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/hu.php
Expand Up @@ -642,7 +642,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/it.php
Expand Up @@ -657,7 +657,7 @@
"543" => "Risultati limitati a 100 su %s.",
"544" => "Visualizza tutti",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/ja.php
Expand Up @@ -642,7 +642,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* 文章はここまで */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/kr.php
Expand Up @@ -646,7 +646,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/nl.php
Expand Up @@ -643,7 +643,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/no.php
Expand Up @@ -641,7 +641,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/pl.php
Expand Up @@ -637,7 +637,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/pt-br.php
Expand Up @@ -641,7 +641,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/pt.php
Expand Up @@ -637,7 +637,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/ru.php
Expand Up @@ -639,7 +639,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
);
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/si.php
Expand Up @@ -638,7 +638,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/sv.php
Expand Up @@ -637,7 +637,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/tr.php
Expand Up @@ -640,7 +640,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/zh-tw.php
Expand Up @@ -640,7 +640,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/i18n/zh.php
Expand Up @@ -649,7 +649,7 @@
"543" => "Results limited to 100 out of %s.",
"544" => "Show All",
"545" => "Remote Share Dialog",
"546" => "This item has been shared with you from a remote location. Do you want to continue ?",
"546" => "This item has been shared with you by %%OWNER%% from a remote location. Do you want to continue ?",
"547" => "Accept",
"548" => "Decline"
/* END SENTENCE */
Expand Down
26 changes: 24 additions & 2 deletions core/src/plugins/core.ocs/src/Model/RemoteShare.php
Expand Up @@ -57,6 +57,10 @@ class RemoteShare
*/
var $sender;

/**
* @var string
*/
var $host;
/**
* @var string
*/
Expand Down Expand Up @@ -133,14 +137,17 @@ public function buildVirtualRepository(){
"META_SOURCES" => array()
)
);

$remoteHost = $this->getHost();
$remoteHost = !empty($remoteHost) ? '@' . $remoteHost : ' [remote]';
$repo = \ConfService::createRepositoryFromArray($repositoryId, $data);
$repo->setRepositoryType("remote");
$repo->setAccessStatus($this->getStatus() == OCS_INVITATION_STATUS_ACCEPTED ? "accepted":"");
$repo->setWriteable(false);
$repo->setOwnerData(null, $this->getSender()." [remote]");
$repo->setOwnerData(null, $this->getSender().$remoteHost);
if($this->isDocumentIsLeaf()){
$contentFilter = new \ContentFilter(array());
$contentFilter->filters["/".$this->getDocumentName()] = "/".$this->getDocumentName();
$contentFilter->filters["/".$this->getDocumentName()] = "/"; // . $this->getDocumentName();
$repo->setContentFilter($contentFilter);
}
return $repo;
Expand Down Expand Up @@ -237,6 +244,13 @@ public function getSender()
return $this->sender;
}

/**
* @return string
*/
public function getHost()
{
return $this->host;
}
/**
* @return string
*/
Expand Down Expand Up @@ -333,6 +347,14 @@ public function setSender($sender)
$this->sender = $sender;
}

/**
* @param string $host
*/
public function setHost($host)
{
$this->host = $host;
}

/**
* @param string $ocsServiceUrl
*/
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/core.ocs/src/Server/Federated/Server.php
Expand Up @@ -83,6 +83,7 @@ protected function actionReceive($parameters){
$share->setReceptionDate(time());
$share->setStatus(OCS_INVITATION_STATUS_PENDING);

$share->setHost(rtrim($remote, '/'));
$share->setOcsServiceUrl(rtrim($remote, '/').$endpoints['share']);
$share->setOcsDavUrl(rtrim($remote, '/').$endpoints['webdav']);

Expand Down
22 changes: 19 additions & 3 deletions core/src/plugins/gui.ajax/res/js/ui/reactjs/jsx/LeftNavigation.js
Expand Up @@ -413,8 +413,17 @@
handleOpenAlert: function () {
this.wrapper = document.body.appendChild(document.createElement('div'));
this.wrapper.style.zIndex = 11;
var replacements = {
'%%OWNER%%': this.props.workspace.getOwner()
};
var component = React.render(
<Confirm {...this.props} onAccept={this.handleAccept.bind(this)} onDecline={this.handleDecline.bind(this)} onDismiss={this.handleCloseAlert} />, this.wrapper);
<Confirm
{...this.props}
replacements={replacements}
onAccept={this.handleAccept.bind(this)}
onDecline={this.handleDecline.bind(this)}
onDismiss={this.handleCloseAlert}
/>, this.wrapper);
},

handleCloseAlert: function() {
Expand Down Expand Up @@ -513,22 +522,29 @@

render: function () {
var messages = this.props.pydio.MessageHash,
messageTitle = messages[545],
messageBody = messages[546],
actions = [
{ text: messages[548], ref: 'decline', onClick: this.props.onDecline},
{ text: messages[547], ref: 'accept', onClick: this.props.onAccept}
];

for (var key in this.props.replacements) {
messageTitle = messageTitle.replace(new RegExp(key), this.props.replacements[key]);
messageBody = messageBody.replace(new RegExp(key), this.props.replacements[key]);
}

return <div className='react-mui-context' style={{position: 'fixed', top: 0, left: 0, width: '100%', height: '100%', background: 'transparent'}}>
<ReactMUI.Dialog
ref="dialog"
title={messages[545]}
title={messageTitle}
actions={actions}
modal={false}
dismissOnClickAway={true}
onDismiss={this.props.onDismiss.bind(this)}
open={true}
>
{messages[546]}
{messageBody}
</ReactMUI.Dialog>
</div>
}
Expand Down

0 comments on commit 4965331

Please sign in to comment.