|
|
|
@ -26,6 +26,7 @@ declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace OCA\Files_Sharing\Listener;
|
|
|
|
|
|
|
|
|
|
use OCA\Files_Sharing\AppInfo\Application;
|
|
|
|
|
use OCP\EventDispatcher\Event;
|
|
|
|
|
use OCP\EventDispatcher\IEventListener;
|
|
|
|
|
use OCP\IConfig;
|
|
|
|
@ -74,7 +75,9 @@ class UserShareAcceptanceListener implements IEventListener {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function handleAutoAccept(IShare $share, string $userId) {
|
|
|
|
|
if ($this->config->getUserValue($userId, 'files_sharing','default_accept','no') === 'yes') {
|
|
|
|
|
$defaultAcceptSystemConfig = $this->config->getSystemValueBool('sharing.enable_share_accept', false) ? 'no' : 'yes';
|
|
|
|
|
$acceptDefault = $this->config->getUserValue($userId, Application::APP_ID, 'default_accept', $defaultAcceptSystemConfig) === 'yes';
|
|
|
|
|
if (!$this->config->getSystemValueBool('sharing.force_share_accept', false) && $acceptDefault) {
|
|
|
|
|
$this->shareManager->acceptShare($share, $userId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|