1
0

encryption.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. *
  7. * @license GNU AGPL version 3 or any later version
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. /** @var \OCP\IL10N $l */
  24. /** @var array $_ */
  25. ?>
  26. <div class="section" id='encryptionAPI'>
  27. <h2><?php p($l->t('Server-side encryption')); ?></h2>
  28. <a target="_blank" rel="noreferrer" class="icon-info"
  29. title="<?php p($l->t('Open documentation'));?>"
  30. href="<?php p(link_to_docs('admin-encryption')); ?>"></a>
  31. <p id="enable">
  32. <input type="checkbox"
  33. id="enableEncryption" class="checkbox"
  34. value="1" <?php if ($_['encryptionEnabled']) print_unescaped('checked="checked" disabled="disabled"'); ?> />
  35. <label
  36. for="enableEncryption"><?php p($l->t('Enable server-side encryption')); ?> <span id="startmigration_msg" class="msg"></span> </label><br/>
  37. </p>
  38. <div id="EncryptionWarning" class="warning hidden">
  39. <p><?php p($l->t('Please read carefully before activating server-side encryption: ')); ?></p>
  40. <ul>
  41. <li><?php p($l->t('Once encryption is enabled, all files uploaded to the server from that point forward will be encrypted at rest on the server. It will only be possible to disable encryption at a later date if the active encryption module supports that function, and all pre-conditions (e.g. setting a recover key) are met.')); ?></li>
  42. <li><?php p($l->t('Encryption alone does not guarantee security of the system. Please see documentation for more information about how the encryption app works, and the supported use cases.')); ?></li>
  43. <li><?php p($l->t('Be aware that encryption always increases the file size.')); ?></li>
  44. <li><?php p($l->t('It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data.')); ?></li>
  45. </ul>
  46. <p><?php p($l->t('This is the final warning: Do you really want to enable encryption?')) ?> <input type="button"
  47. id="reallyEnableEncryption"
  48. value="<?php p($l->t("Enable encryption")); ?>" /></p>
  49. </div>
  50. <div id="EncryptionSettingsArea" class="<?php if (!$_['encryptionEnabled']) p('hidden'); ?>">
  51. <div id='selectEncryptionModules' class="<?php if (!$_['encryptionReady']) p('hidden'); ?>">
  52. <?php
  53. if (empty($_['encryptionModules'])) {
  54. p($l->t('No encryption module loaded, please enable an encryption module in the app menu.'));
  55. } else { ?>
  56. <h3><?php p($l->t('Select default encryption module:')) ?></h3>
  57. <fieldset id='encryptionModules'>
  58. <?php foreach ($_['encryptionModules'] as $id => $module): ?>
  59. <input type="radio" id="<?php p($id) ?>"
  60. name="default_encryption_module"
  61. value="<?php p($id) ?>"
  62. <?php if ($module['default']) {
  63. p('checked');
  64. } ?>>
  65. <label
  66. for="<?php p($id) ?>"><?php p($module['displayName']) ?></label>
  67. <br/>
  68. <?php endforeach; ?>
  69. </fieldset>
  70. <?php } ?>
  71. </div>
  72. <div id="migrationWarning" class="<?php if ($_['encryptionReady']) p('hidden'); ?>">
  73. <?php
  74. if ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === true) {
  75. p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the "Default encryption module" and run \'occ encryption:migrate\''));
  76. } elseif ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === false) {
  77. p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one.')); ?>
  78. <input type="submit" name="startmigration" id="startmigration"
  79. value="<?php p($l->t('Start migration')); ?>"/>
  80. <?php } ?>
  81. </div>
  82. </div>
  83. </div>