make encryption filetype blacklist configurable

This commit is contained in:
Robin Appelman 2012-02-22 22:20:46 +01:00
parent 2e05bd69f5
commit 814bc2fd2b
4 changed files with 48 additions and 0 deletions

View File

@ -15,3 +15,5 @@ if(!isset($_SESSION['enckey']) and OC_User::isLoggedIn()){//force the user to re
header("Location: ".OC::$WEBROOT.'/');
exit();
}
OC_App::registerAdmin('files_encryption', 'settings');

View File

@ -0,0 +1,19 @@
/**
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
$(document).ready(function(){
$('#encryption_blacklist').multiSelect({
oncheck:blackListChange,
onuncheck:blackListChange,
createText:'...',
});
function blackListChange(){
var blackList=$('#encryption_blacklist').val().join(',');
OC.AppConfig.setValue('files_encryption','type_blacklist',blackList);
}
})

View File

@ -0,0 +1,16 @@
<?php
/**
* Copyright (c) 2011 Robin Appelman <icewind@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
$tmpl = new OC_Template( 'files_encryption', 'settings');
$blackList=explode(',',OC_Appconfig::getValue('files_encryption','type_blacklist','jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
$tmpl->assign('blacklist',$blackList);
OC_Util::addScript('files_encryption','settings');
OC_Util::addScript('core','multiselect');
return $tmpl->fetchPage();

View File

@ -0,0 +1,11 @@
<form id="calendar">
<fieldset class="personalblock">
<strong><?php echo $l->t('Encryption'); ?></strong>
<?php echo $l->t("Exclude the following file types from encryption"); ?>
<select id='encryption_blacklist' title="<?php echo $l->t('None')?>" multiple="multiple">
<?php foreach($_["blacklist"] as $type): ?>
<option selected="selected" value="<?php echo $type;?>"><?php echo $type;?></option>
<?php endforeach;?>
</select>
</fieldset>
</form>