}
+// Reguster settings scripts
OCP\App::registerAdmin( 'files_encryption', 'settings' );
-
-// This is disabled until client-side encryption is supported:
-// OCP\App::registerPersonal( 'files_encryption', 'settings-personal' );
\ No newline at end of file
+OCP\App::registerPersonal( 'files_encryption', 'settings-personal' );
\ No newline at end of file
<?php\r
/**\r
- * Copyright (c) 2012 Bjoern Schiessle <schiessle@owncloud.com>\r
+ * Copyright (c) 2013 Sam Tuke <samtuke@owncloud.com>\r
* This file is licensed under the Affero General Public License version 3 or\r
* later.\r
* See the COPYING-README file.\r
*/\r
\r
-$sysEncMode = \OC_Appconfig::getValue('files_encryption', 'mode', 'none');\r
+$tmpl = new OCP\Template( 'files_encryption', 'settings-personal');\r
\r
-if ($sysEncMode == 'user') {\r
+$blackList = explode( ',', \OCP\Config::getAppValue( 'files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg' ) );\r
\r
- $tmpl = new OCP\Template( 'files_encryption', 'settings-personal');\r
+$tmpl->assign( 'blacklist', $blackList );\r
\r
- $query = \OC_DB::prepare( "SELECT mode FROM *PREFIX*encryption WHERE uid = ?" );\r
- $result = $query->execute(array(\OCP\User::getUser()));\r
- \r
- if ($row = $result->fetchRow()){\r
- $mode = $row['mode'];\r
- } else {\r
- $mode = 'none';\r
- }\r
- \r
- OCP\Util::addscript('files_encryption','settings-personal');\r
- $tmpl->assign('encryption_mode', $mode);\r
- return $tmpl->fetchPage();\r
-}\r
+OCP\Util::addscript('files_encryption','settings-personal');\r
+\r
+return $tmpl->fetchPage();\r
\r
return null;\r
<form id="encryption">\r
<fieldset class="personalblock">\r
- <strong><?php echo $l->t( 'Choose encryption mode:' ); ?></strong>\r
+ <legend>\r
+ <?php echo $l->t( 'Encryption' ); ?>\r
+ </legend>\r
<p>\r
- <input \r
- type="hidden" \r
- name="prev_encryption_mode" \r
- id="prev_encryption_mode" \r
- value="<?php echo $_['encryption_mode']; ?>"\r
- >\r
- \r
- <input \r
- type="radio" \r
- name="encryption_mode" \r
- value="server" \r
- id='server_encryption' \r
- style="width:20px;" <?php if ( $_['encryption_mode'] == 'server' ) echo "checked='checked'" ?>\r
- /> \r
- <?php echo $l->t( 'Server side encryption (allows you to access your files from the web interface)' ); ?>\r
- <br />\r
- \r
- <input \r
- type="radio" \r
- name="encryption_mode" \r
- value="none" \r
- id='none_encryption' \r
- style="width:20px;" \r
- <?php if ( $_['encryption_mode'] == 'none' ) echo "checked='checked'" ?>\r
- /> \r
- <?php echo $l->t( 'None (no encryption at all)' ); ?>\r
- <br/>\r
+ <?php echo $l->t( 'File encryption is enabled.' ); ?>\r
</p>\r
+ <?php if ( ! empty( $_["blacklist"] ) ): ?>\r
+ <p>The following file types will not be encrypted:</p>\r
+ <ul>\r
+ <?php foreach( $_["blacklist"] as $type ): ?>\r
+ <li>\r
+ <?php echo $type; ?>\r
+ </li>\r
+ <?php endforeach; ?>\r
+ </p>\r
+ <?php endif; ?>\r
</fieldset>\r
</form>\r