error.php 866 B

123456789101112131415161718192021222324
  1. <?php
  2. if (!isset($_)) { //also provide standalone error page
  3. require_once '../../../lib/base.php';
  4. $l = OC_L10N::get('files_encryption');
  5. $errorMsg = $l->t('Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.');
  6. if(isset($_GET['p']) && $_GET['p'] === '1') {
  7. header('HTTP/1.0 404 ' . $errorMsg);
  8. }
  9. // check if ajax request
  10. if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
  11. \OCP\JSON::error(array('data' => array('message' => $errorMsg)));
  12. } else {
  13. header('HTTP/1.0 404 ' . $errorMsg);
  14. $tmpl = new OC_Template('files_encryption', 'invalid_private_key', 'guest');
  15. $tmpl->printPage();
  16. }
  17. exit;
  18. }