Contributing back some bug fixes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

database_key.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?
  2. // if set, do not enforce login so we can set the encryption key w/o an account
  3. if (!FEATURE_SET_ENC_KEY_PUBLIC) {
  4. if (!check_perms('site_debug')) {
  5. error(403);
  6. }
  7. }
  8. if (isset($_POST['dbkey'])) {
  9. // if set, do not enforce login so we can set the encryption key w/o an account
  10. if (!FEATURE_SET_ENC_KEY_PUBLIC) {
  11. authorize();
  12. }
  13. apcu_store('DBKEY', hash('sha512', $_POST['dbkey']));
  14. }
  15. View::show_header('Database Encryption Key');
  16. ?>
  17. <div class="header">
  18. <h2>Database Encryption Key</h2>
  19. </div>
  20. <div class="box pad slight_margin">
  21. <h4>There is <?=((apcu_exists('DBKEY') && apcu_fetch('DBKEY'))?"already a":"NO")?> key loaded</h4>
  22. <form class="create_form" name="db_key" action="" method="post">
  23. <input type="hidden" name="action" value="database_key" />
  24. <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
  25. <div style="display: flex;">
  26. <input type="text" name="dbkey" style="flex-grow: 1;" />
  27. <input type="submit" name="submit" value="Update key" />
  28. </div>
  29. </form>
  30. </div>
  31. <? View::show_footer(); ?>