1
0

settings-admin.php 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. /** @var array $_ */
  8. /** @var \OCP\IL10N $l */
  9. script('encryption', 'settings-admin');
  10. style('encryption', 'settings-admin');
  11. ?>
  12. <form id="ocDefaultEncryptionModule" class="sub-section">
  13. <h3><?php p($l->t('Default encryption module')); ?></h3>
  14. <?php if (!$_['initStatus'] && $_['masterKeyEnabled'] === false): ?>
  15. <?php p($l->t('Encryption app is enabled but your keys are not initialized, please log-out and log-in again')); ?>
  16. <?php else: ?>
  17. <p id="encryptHomeStorageSetting">
  18. <input type="checkbox" class="checkbox" name="encrypt_home_storage" id="encryptHomeStorage"
  19. value="1" <?php if ($_['encryptHomeStorage']) {
  20. print_unescaped('checked="checked"');
  21. } ?> />
  22. <label for="encryptHomeStorage"><?php p($l->t('Encrypt the home storage'));?></label></br>
  23. <em><?php p($l->t('Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted')); ?></em>
  24. </p>
  25. <br />
  26. <?php if ($_['masterKeyEnabled'] === false): ?>
  27. <p id="encryptionSetRecoveryKey">
  28. <?php $_['recoveryEnabled'] === '0' ? p($l->t('Enable recovery key')) : p($l->t('Disable recovery key')); ?>
  29. <span class="msg"></span>
  30. <br/>
  31. <em>
  32. <?php p($l->t('The recovery key is an additional encryption key used to encrypt files. It is used to recover files from an account if the password is forgotten.')) ?>
  33. </em>
  34. <br/>
  35. <input type="password"
  36. name="encryptionRecoveryPassword"
  37. id="encryptionRecoveryPassword"
  38. placeholder="<?php p($l->t('Recovery key password')); ?>"/>
  39. <input type="password"
  40. name="encryptionRecoveryPassword"
  41. id="repeatEncryptionRecoveryPassword"
  42. placeholder="<?php p($l->t('Repeat recovery key password')); ?>"/>
  43. <input type="button"
  44. name="enableRecoveryKey"
  45. id="enableRecoveryKey"
  46. status="<?php p($_['recoveryEnabled']) ?>"
  47. value="<?php $_['recoveryEnabled'] === '0' ? p($l->t('Enable recovery key')) : p($l->t('Disable recovery key')); ?>"/>
  48. </p>
  49. <br/><br/>
  50. <p name="changeRecoveryPasswordBlock" id="encryptionChangeRecoveryKey" <?php if ($_['recoveryEnabled'] === '0') {
  51. print_unescaped('class="hidden"');
  52. }?>>
  53. <?php p($l->t('Change recovery key password:')); ?>
  54. <span class="msg"></span>
  55. <br/>
  56. <input
  57. type="password"
  58. name="changeRecoveryPassword"
  59. id="oldEncryptionRecoveryPassword"
  60. placeholder="<?php p($l->t('Old recovery key password')); ?>"/>
  61. <br />
  62. <input
  63. type="password"
  64. name="changeRecoveryPassword"
  65. id="newEncryptionRecoveryPassword"
  66. placeholder="<?php p($l->t('New recovery key password')); ?>"/>
  67. <input
  68. type="password"
  69. name="changeRecoveryPassword"
  70. id="repeatedNewEncryptionRecoveryPassword"
  71. placeholder="<?php p($l->t('Repeat new recovery key password')); ?>"/>
  72. <button
  73. type="button"
  74. name="submitChangeRecoveryKey">
  75. <?php p($l->t('Change Password')); ?>
  76. </button>
  77. </p>
  78. <?php endif; ?>
  79. <?php endif; ?>
  80. </form>