summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/helper.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-06 12:27:40 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-06 12:27:40 +0200
commitfb462e83ccde5c46565c23545c5eb894acbd6fd3 (patch)
tree4b334e82c8e61247419f4120b18922fc923f5cf7 /apps/files_encryption/lib/helper.php
parent69b1625f0e368e65771fef473f4b4d4a13456354 (diff)
downloadnextcloud-server-fb462e83ccde5c46565c23545c5eb894acbd6fd3.tar.gz
nextcloud-server-fb462e83ccde5c46565c23545c5eb894acbd6fd3.zip
no longer enforce log out, but provide useful errors/warnings instead
Diffstat (limited to 'apps/files_encryption/lib/helper.php')
-rwxr-xr-xapps/files_encryption/lib/helper.php27
1 files changed, 7 insertions, 20 deletions
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index 7d466b88523..048473ce846 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -237,28 +237,15 @@ class Helper {
*/
public static function redirectToErrorPage($session) {
- $l = \OC_L10N::get('files_encryption');
-
- if ($session->getInitialized() === false) {
- $errorMsg = $l->t('Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app.');
- } else {
- $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.');
- }
+ $init = $session->getInitialized();
+ $location = \OC_Helper::linkToAbsolute('apps/files_encryption/files', 'error.php');
+ $post = 0;
if(count($_POST) > 0) {
- header('HTTP/1.0 404 ' . $errorMsg);
- }
-
- // check if ajax request
- if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
- \OCP\JSON::error(array('data' => array('message' => $errorMsg)));
- } else {
- header('HTTP/1.0 404 ' . $errorMsg);
- $tmpl = new OC_Template('files_encryption', 'invalid_private_key', 'guest');
- $tmpl->printPage();
- }
-
- exit;
+ $post = 1;
+ }
+ header('Location: ' . $location . '?p=' . $post . '&i=' . $init);
+ exit();
}
/**