]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added notice to personal settings indicating what filetypes are not encrypted
authorSam Tuke <samtuke@owncloud.com>
Tue, 5 Feb 2013 17:06:15 +0000 (17:06 +0000)
committerSam Tuke <samtuke@owncloud.com>
Tue, 5 Feb 2013 17:06:15 +0000 (17:06 +0000)
apps/files_encryption/appinfo/app.php
apps/files_encryption/settings-personal.php
apps/files_encryption/templates/settings-personal.php

index 20045f34b08433d48eddfbef00a007a46d382598..e426f237bbe467b4613d7dc3b52df01dfa27b273 100644 (file)
@@ -43,7 +43,6 @@ if (
 
 }
 
+// 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
index 014288f2efe7d4dff3f79bf0a9a4775dd4e3ad63..6fe4ea6d564c1b84ed64901941155aaf77c32ccf 100644 (file)
@@ -1,29 +1,19 @@
 <?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
index ad34a0d78b91a3d806b3a9340c5011d723223513..5931a4cdeb03ad55238b6af61501146acd6c37c1 100644 (file)
@@ -1,34 +1,20 @@
 <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