diff options
Diffstat (limited to 'apps/files_encryption')
-rw-r--r-- | apps/files_encryption/js/settings.js | 5 | ||||
-rw-r--r-- | apps/files_encryption/lib/proxy.php | 6 | ||||
-rw-r--r-- | apps/files_encryption/settings.php | 2 | ||||
-rw-r--r-- | apps/files_encryption/templates/settings.php | 1 |
4 files changed, 11 insertions, 3 deletions
diff --git a/apps/files_encryption/js/settings.js b/apps/files_encryption/js/settings.js index adbf0c87245..37d62265c94 100644 --- a/apps/files_encryption/js/settings.js +++ b/apps/files_encryption/js/settings.js @@ -16,4 +16,9 @@ $(document).ready(function(){ var blackList=$('#encryption_blacklist').val().join(','); OC.AppConfig.setValue('files_encryption','type_blacklist',blackList); } + + $('#enbale_encryption').change(function(){ + var checked=$('#enbale_encryption').is(':checked'); + OC.AppConfig.setValue('files_encryption','enable_encryption',(checked)?'true':'false'); + }) })
\ No newline at end of file diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index a0de411a7b6..e3a106d0d04 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -36,10 +36,10 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ * @return bool */ private static function shouldEncrypt($path){ - if(is_null($this->enableEncryption)){ - $this->enableEncryption=(OC_Appconfig::getValue('files_encryption','enabled','true')=='true'); + if(is_null(self::$enableEncryption)){ + self::$enableEncryption=(OC_Appconfig::getValue('files_encryption','enable_encryption','true')=='true'); } - if(!$this->enableEncryption){ + if(!self::$enableEncryption){ return false; } if(is_null(self::$blackList)){ diff --git a/apps/files_encryption/settings.php b/apps/files_encryption/settings.php index 396ad1ba78d..01caefd1249 100644 --- a/apps/files_encryption/settings.php +++ b/apps/files_encryption/settings.php @@ -8,7 +8,9 @@ $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')); +$enabled=(OC_Appconfig::getValue('files_encryption','enable_encryption','true')=='true'); $tmpl->assign('blacklist',$blackList); +$tmpl->assign('encryption_enabled',$enabled); OC_Util::addScript('files_encryption','settings'); OC_Util::addScript('core','multiselect'); diff --git a/apps/files_encryption/templates/settings.php b/apps/files_encryption/templates/settings.php index 724a03836a8..25b5a06f56c 100644 --- a/apps/files_encryption/templates/settings.php +++ b/apps/files_encryption/templates/settings.php @@ -7,5 +7,6 @@ <option selected="selected" value="<?php echo $type;?>"><?php echo $type;?></option> <?php endforeach;?> </select> + <input type='checkbox' id='enbale_encryption' <?php if($_['encryption_enabled']){echo 'checked="checked"';} ?>></input><label for='enbale_encryption'><?php echo $l->t('Enable Encryption')?></label> </fieldset> </form> |