Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable "Add to your nextcloud" option in public share links #12395

Closed
Nottt opened this issue Nov 10, 2018 · 8 comments · Fixed by #13261
Closed

Disable "Add to your nextcloud" option in public share links #12395

Nottt opened this issue Nov 10, 2018 · 8 comments · Fixed by #13261
Labels
enhancement feature: sharing good first issue Small tasks with clear documentation about how and in which place you need to fix things in.
Milestone

Comments

@Nottt
Copy link

Nottt commented Nov 10, 2018

I want to disable any kind of federation sharing.

I've disabled the federation app, unchecked all Federated Cloud Sharing options and I still can't get rid of this option.

image

Netxcloud version 14.0.3

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #9434 (Public Sharing), #11375 (Nextcloud is sending Emails even if link sharing is disabled once created a share by a user), #1916 (discussion: remove "send email" option for public links), #10869 (Disabled users should have their shared file links disabled?), and #1639 (Unable to access public shared link).

@violoncelloCH violoncelloCH added enhancement good first issue Small tasks with clear documentation about how and in which place you need to fix things in. labels Nov 10, 2018
@Nottt
Copy link
Author

Nottt commented Nov 16, 2018

I have edited the following files to remove any mention of save-external-share

ExternalShareMenuAction.php
public.scss
publicpage.js
public.js

Restarted the container, but that option is still there. Why? If I go into chrome console and delete:

<a id="save-external-share" data-protected="false" data-owner-display-name="redacted" data-owner="redacted" data-name="redacted"><span class="icon icon-external"></span><label for="remote_address">Add to your Nextcloud</label><form class="save-form hidden" action="#"><input type="text" id="remote_address" placeholder="[email protected]"><input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></form></a>

It gets hidden. Any help? I really need this to be hidden

Edit:

After more research I found the file ShareController.php and deleted:

new ExternalShareMenuAction($this->l10n->t('Add to your Nextcloud'), 'icon-external', $shareTmpl['owner'], $shareTmpl['displayName'], $shareTmpl['filename']),

That removed that option for me. I don't know if this single change is necessary, or if the other changes I did before is necessary too.

However I'd still like if this could be a option in the menu or a settings in the config files.

Edit2:

Only the change in ShareController.php seems to be necessary to hide it.

@violoncelloCH
Copy link
Member

We should probably only show this if federation is enabled, because otherwise it's quite useless. This would mean not showing it if federation is disabled or the federation app is not installed/enabled at all.

@mxs42
Copy link

mxs42 commented Dec 24, 2018

So there is no way to disable it currently without manual editing of source?

@violoncelloCH
Copy link
Member

fix is in #13261
however as the federated sharing settings are still there if the federation app is deactivated, "add to your Nextcloud" is also only deactivated if the option in the settings is explicitly disabled and not if only the app is deactivated.

@MorrisJobke MorrisJobke added this to the Nextcloud 16 milestone Jan 30, 2019
@tuxcrafter
Copy link

sudo -u apache ./occ app:disable federatedfilesharing
federatedfilesharing can't be disabled.

Is there a way for nextcloud to disable federatedfilesharing to prevent the bellow error?

Sharing doc02.odt failed, could not find [email protected], maybe the server is currently unreachable or uses a self-signed certificate.

@renoaldocosta
Copy link

renoaldocosta commented Aug 18, 2022

To disable I simply negated the condition with "!" in controller.php file
Before was:

if ($this->federatedShareProvider->isOutgoingServer2serverShareEnabled()) {
$responseComposer[] = $externalShare;
}

Then I added the "!"

if (!$this->federatedShareProvider->isOutgoingServer2serverShareEnabled()) {
$responseComposer[] = $externalShare;
}

pboguslawski added a commit to ibpl/server that referenced this issue Aug 26, 2022
…hares

Added app `files_sharing` parameter `showExternalShareOption` to allow one to hide
"Add to your nextcloud" option in public shares (shown by default). Use
```
occ config:app:set files_sharing showExternalShareOption --value='no'
```
to hide and
```
occ config:app:set files_sharing showExternalShareOption --value='yes'
```
to restore.

Related: nextcloud#12395
Author-Change-Id: IB#1123210
Signed-off-by: Pawel Boguslawski <[email protected]>
pboguslawski added a commit to ibpl/server that referenced this issue Aug 26, 2022
…hares

Added app `files_sharing` parameter `showExternalShareOption` to allow one to hide
"Add to your nextcloud" option in public shares (shown by default). Use
```
occ config:app:set files_sharing showExternalShareOption --value='no'
```
to hide and
```
occ config:app:set files_sharing showExternalShareOption --value='yes'
```
to restore.

Related: nextcloud#12395
Author-Change-Id: IB#1123210
Signed-off-by: Pawel Boguslawski <[email protected]>
@pboguslawski
Copy link
Contributor

See #33715

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature: sharing good first issue Small tasks with clear documentation about how and in which place you need to fix things in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants