--- /dev/null
+<?php
+
+require_once('../../../lib/base.php');
+
+OC_JSON::checkAppEnabled('files_sharing');
+OC_JSON::checkAdminUser();
+error_log($_POST['resharing']);
+if ($_POST['resharing'] == true) {
+ error_log("enabling");
+ OC_Appconfig::setValue('files_sharing', 'resharing', 'yes');
+} else {
+ error_log("disabling");
+ OC_Appconfig::setValue('files_sharing', 'resharing', 'no');
+}
+
+?>
require_once('apps/files_sharing/sharedstorage.php');
OC::$CLASSPATH['OC_Share'] = "apps/files_sharing/lib_share.php";
+OC_APP::registerAdmin('files_sharing', 'settings');
OC_Hook::connect("OC_Filesystem", "post_delete", "OC_Share", "deleteItem");
OC_Hook::connect("OC_Filesystem", "post_rename", "OC_Share", "renameItem");
OC_Hook::connect("OC_Filesystem", "post_write", "OC_Share", "updateItem");
-OC_Util::addScript("files_sharing", "share");
+$dir = isset($_GET['dir']) ? $_GET['dir'] : '/';
+if ($dir != '/Shared' || OC_Appconfig::getValue('files_sharing', 'resharing', 'yes') == 'yes') {
+ OC_Util::addScript("files_sharing", "share");
+}
OC_Util::addScript("3rdparty", "chosen/chosen.jquery.min");
OC_Util::addStyle( 'files_sharing', 'sharing' );
OC_Util::addStyle("3rdparty", "chosen/chosen");
--- /dev/null
+$(document).ready(function() {
+ $('#allowResharing').bind('change', function() {
+ var checked = 1;
+ if (!$('#allowResharing').attr('checked')) {
+ checked = 0;
+ }
+ $.post(OC.filePath('files_sharing','ajax','toggleresharing.php'), 'resharing='+checked);
+ });
+});
\ No newline at end of file
--- /dev/null
+<?php
+
+OC_Util::checkAdminUser();
+OC_Util::addScript('files_sharing', 'settings');
+$tmpl = new OC_Template('files_sharing', 'settings');
+$tmpl->assign('allowResharing', OC_Appconfig::getValue('files_sharing', 'resharing', 'yes'));
+return $tmpl->fetchPage();
+
+?>
\ No newline at end of file
--- /dev/null
+<form id="resharing">
+ <fieldset class="personalblock">
+ <input type="checkbox" name="allowResharing" id="allowResharing" value="1" <?php if ($_['allowResharing'] == 'yes') echo ' checked="checked"'; ?> /> <label for="allowResharing"><?php echo $l->t('Enable Resharing'); ?></label> <br/>
+ <em><?php echo $l->t('Allow users to reshare files they don\'t own');?></em>
+ </fieldset>
+</form>
\ No newline at end of file