PageRenderTime 45ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/apps/files_encryption/files/error.php

https://github.com/sezuan/core
PHP | 23 lines | 17 code | 5 blank | 1 comment | 7 complexity | 2e5930f51f36bdee02f56ea96a9508eb MD5 | raw file
Possible License(s): AGPL-3.0, AGPL-1.0, MPL-2.0-no-copyleft-exception
  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. }