Allow admin to disable resharing of files
This commit is contained in:
parent
a3dff248a1
commit
b369adbd94
|
@ -0,0 +1,16 @@
|
|||
<?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');
|
||||
}
|
||||
|
||||
?>
|
|
@ -3,10 +3,14 @@
|
|||
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");
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
$(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);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,9 @@
|
|||
<?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();
|
||||
|
||||
?>
|
|
@ -0,0 +1,6 @@
|
|||
<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>
|
Loading…
Reference in New Issue