]> source.dussan.org Git - nextcloud-server.git/commitdiff
No admin option to enable public upload in case encryption is enabled
authorThomas Müller <thomas.mueller@tmit.eu>
Sun, 14 Jul 2013 19:58:08 +0000 (21:58 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Sun, 14 Jul 2013 19:58:08 +0000 (21:58 +0200)
No upload on pubic page if public upload is disabled

apps/files_sharing/public.php
settings/templates/admin.php

index 695c00e55418b5ea3846b596b34e1aee663d3ff0..3f8e29345a7f2e0118986a6afe4a66f2ed90537c 100644 (file)
@@ -137,6 +137,9 @@ if (isset($path)) {
                if (\OCP\App::isEnabled('files_encryption')) {
                        $allowPublicUploadEnabled = false;
                }
+               if (OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes') === 'no') {
+                       $allowPublicUploadEnabled = false;
+               }
                if ($linkItem['item_type'] !== 'folder') {
                        $allowPublicUploadEnabled = false;
                }
@@ -202,7 +205,7 @@ if (isset($path)) {
                        $folder->assign('isCreatable', false);
                        $folder->assign('permissions', OCP\PERMISSION_READ);
                        $folder->assign('isPublic',true);
-                       $folder->assign('publicUploadEnabled', true);
+                       $folder->assign('publicUploadEnabled', 'no');
                        $folder->assign('files', $files);
                        $folder->assign('uploadMaxFilesize', $maxUploadFilesize);
                        $folder->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
index 9f16db0948d124051cc0c28dfc2efe10fc39345a..6c4fddd375d9944a39019f3f9f1d51fcc37b24b3 100644 (file)
@@ -145,6 +145,7 @@ if (!$_['internetconnectionworking']) {
                                <em><?php p($l->t('Allow users to share items to the public with links')); ?></em>
                        </td>
                </tr>
+               <?php if (!\OCP\App::isEnabled('files_encryption')) { ?>
                <tr>
                        <td <?php if ($_['shareAPIEnabled'] == 'no') print_unescaped('style="display:none"');?>>
                                <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload"
@@ -153,6 +154,7 @@ if (!$_['internetconnectionworking']) {
                                <em><?php p($l->t('Allow users to enable others to anonymously upload into their publicly shared folders')); ?></em>
                        </td>
                </tr>
+               <?php } ?>
                <tr>
                        <td <?php if ($_['shareAPIEnabled'] == 'no') print_unescaped('style="display:none"');?>>
                                <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing"