fix checkstyle for files_encryption app, add whitespace for readability
This commit is contained in:
parent
3b83fe1530
commit
df21ebeaf7
|
@ -10,7 +10,9 @@ OCP\Util::connectHook('OC_User', 'post_login', 'OC_Crypt', 'loginListener');
|
||||||
|
|
||||||
stream_wrapper_register('crypt', 'OC_CryptStream');
|
stream_wrapper_register('crypt', 'OC_CryptStream');
|
||||||
|
|
||||||
if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()) {//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
|
// force the user to re-loggin if the encryption key isn't unlocked
|
||||||
|
// (happens when a user is logged in before the encryption app is enabled)
|
||||||
|
if ( ! isset($_SESSION['enckey']) and OCP\User::isLoggedIn()) {
|
||||||
OCP\User::logout();
|
OCP\User::logout();
|
||||||
header("Location: ".OC::$WEBROOT.'/');
|
header("Location: ".OC::$WEBROOT.'/');
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
// - Setting if crypto should be on by default
|
// - Setting if crypto should be on by default
|
||||||
// - Add a setting "Don´t encrypt files larger than xx because of performance reasons"
|
// - Add a setting "Don´t encrypt files larger than xx because of performance reasons"
|
||||||
// - Transparent decrypt/encrypt in filesystem.php. Autodetect if a file is encrypted (.encrypted extension)
|
// - Transparent decrypt/encrypt in filesystem.php. Autodetect if a file is encrypted (.encrypted extension)
|
||||||
// - Don't use a password directly as encryption key. but a key which is stored on the server and encrypted with the user password. -> password change faster
|
// - Don't use a password directly as encryption key, but a key which is stored on the server and encrypted with the
|
||||||
|
// user password. -> password change faster
|
||||||
// - IMPORTANT! Check if the block lenght of the encrypted data stays the same
|
// - IMPORTANT! Check if the block lenght of the encrypted data stays the same
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
/**
|
/**
|
||||||
* transparently encrypted filestream
|
* transparently encrypted filestream
|
||||||
*
|
*
|
||||||
* you can use it as wrapper around an existing stream by setting OC_CryptStream::$sourceStreams['foo']=array('path'=>$path, 'stream'=>$stream)
|
* you can use it as wrapper around an existing stream by setting
|
||||||
|
* OC_CryptStream::$sourceStreams['foo']=array('path'=>$path, 'stream'=>$stream)
|
||||||
* and then fopen('crypt://streams/foo');
|
* and then fopen('crypt://streams/foo');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -79,7 +80,9 @@ class OC_CryptStream{
|
||||||
//This makes this function a lot simpler but will breake everything the moment it's fixed
|
//This makes this function a lot simpler but will breake everything the moment it's fixed
|
||||||
$this->writeCache='';
|
$this->writeCache='';
|
||||||
if ($count!=8192) {
|
if ($count!=8192) {
|
||||||
OCP\Util::writeLog('files_encryption', 'php bug 21641 no longer holds, decryption will not work', OCP\Util::FATAL);
|
OCP\Util::writeLog('files_encryption',
|
||||||
|
'php bug 21641 no longer holds, decryption will not work',
|
||||||
|
OCP\Util::FATAL);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
$pos=ftell($this->source);
|
$pos=ftell($this->source);
|
||||||
|
|
|
@ -42,7 +42,9 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (is_null(self::$blackList)) {
|
if (is_null(self::$blackList)) {
|
||||||
self::$blackList=explode(',', OCP\Config::getAppValue('files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
|
self::$blackList=explode(',', OCP\Config::getAppValue('files_encryption',
|
||||||
|
'type_blacklist',
|
||||||
|
'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
|
||||||
}
|
}
|
||||||
if (self::isEncrypted($path)) {
|
if (self::isEncrypted($path)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$tmpl = new OCP\Template( 'files_encryption', 'settings');
|
$tmpl = new OCP\Template( 'files_encryption', 'settings');
|
||||||
$blackList=explode(',', OCP\Config::getAppValue('files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
|
$blackList=explode(',', OCP\Config::getAppValue('files_encryption',
|
||||||
|
'type_blacklist',
|
||||||
|
'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
|
||||||
$enabled=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true');
|
$enabled=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true');
|
||||||
$tmpl->assign('blacklist', $blackList);
|
$tmpl->assign('blacklist', $blackList);
|
||||||
$tmpl->assign('encryption_enabled', $enabled);
|
$tmpl->assign('encryption_enabled', $enabled);
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
<form id="calendar">
|
<form id="calendar">
|
||||||
<fieldset class="personalblock">
|
<fieldset class="personalblock">
|
||||||
<strong><?php echo $l->t('Encryption'); ?></strong>
|
<strong><?php echo $l->t('Encryption'); ?></strong>
|
||||||
<?php echo $l->t("Exclude the following file types from encryption"); ?>
|
<?php echo $l->t('Exclude the following file types from encryption'); ?>
|
||||||
<select id='encryption_blacklist' title="<?php echo $l->t('None')?>" multiple="multiple">
|
<select id='encryption_blacklist' title="<?php echo $l->t('None')?>" multiple="multiple">
|
||||||
<?php foreach($_["blacklist"] as $type): ?>
|
<?php foreach ($_['blacklist'] as $type): ?>
|
||||||
<option selected="selected" value="<?php echo $type;?>"><?php echo $type;?></option>
|
<option selected="selected" value="<?php echo $type;?>"><?php echo $type;?></option>
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
</select>
|
</select>
|
||||||
<input type='checkbox' id='enable_encryption' <?php if($_['encryption_enabled']) {echo 'checked="checked"';} ?>></input><label for='enable_encryption'><?php echo $l->t('Enable Encryption')?></label>
|
<input type='checkbox'<?php if ($_['encryption_enabled']): ?> checked="checked"<?php endif; ?>
|
||||||
|
id='enable_encryption' ></input>
|
||||||
|
<label for='enable_encryption'><?php echo $l->t('Enable Encryption')?></label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue