diff options
author | Björn Schießle <bjoern@schiessle.org> | 2013-10-04 02:28:18 -0700 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2013-10-04 02:28:18 -0700 |
commit | 5b7f76e7022f6d3c5cb4038a737df3870e56773b (patch) | |
tree | 3fe96647523e99f7f30db2a619773f44aedb529c /apps/files | |
parent | 1992450b32da7953ff6bd493b8ec5cfbb23d8d92 (diff) | |
parent | 9d2595a7c59048fc6ed3777a888e03d43a8f03f9 (diff) | |
download | nextcloud-server-5b7f76e7022f6d3c5cb4038a737df3870e56773b.tar.gz nextcloud-server-5b7f76e7022f6d3c5cb4038a737df3870e56773b.zip |
Merge pull request #4691 from owncloud/encryption_improved_error_messages_4617
Encryption improved error messages
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/index.php | 7 | ||||
-rw-r--r-- | apps/files/js/files.js | 9 | ||||
-rw-r--r-- | apps/files/templates/index.php | 1 |
3 files changed, 16 insertions, 1 deletions
diff --git a/apps/files/index.php b/apps/files/index.php index 6f22fdfdc19..42eac209b23 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -104,8 +104,12 @@ if ($needUpgrade) { $storageInfo=OC_Helper::getStorageInfo($dir); $maxUploadFilesize=OCP\Util::maxUploadFilesize($dir); $publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'); + // if the encryption app is disabled, than everything is fine (INIT_SUCCESSFUL status code) + $encryptionInitStatus = 2; if (OC_App::isEnabled('files_encryption')) { $publicUploadEnabled = 'no'; + $session = new \OCA\Encryption\Session(new \OC\Files\View('/')); + $encryptionInitStatus = $session->getInitialized(); } $trashEnabled = \OCP\App::isEnabled('files_trashbin'); @@ -113,7 +117,7 @@ if ($needUpgrade) { if ($trashEnabled) { $trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user); } - + OCP\Util::addscript('files', 'fileactions'); OCP\Util::addscript('files', 'files'); OCP\Util::addscript('files', 'keyboardshortcuts'); @@ -133,6 +137,7 @@ if ($needUpgrade) { $tmpl->assign('isPublic', false); $tmpl->assign('publicUploadEnabled', $publicUploadEnabled); $tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles()); + $tmpl->assign("encryptionInitStatus", $encryptionInitStatus); $tmpl->assign('disableSharing', false); $tmpl->assign('ajaxLoad', $ajaxLoad); $tmpl->printPage(); diff --git a/apps/files/js/files.js b/apps/files/js/files.js index ec688eaf63e..899bc6469e5 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -63,6 +63,15 @@ Files={ } var encryptedFiles = $('#encryptedFiles').val(); + var initStatus = $('#encryptionInitStatus').val(); + if (initStatus === '0') { // enc not initialized, but should be + OC.Notification.show(t('files_encryption', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again')); + return; + } + if (initStatus === '1') { // encryption tried to init but failed + OC.Notification.showHtml(t('files_encryption', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.')); + return; + } if (encryptedFiles === '1') { OC.Notification.show(t('files_encryption', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.')); return; diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 50a2720e1c0..1c6cd267d85 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -116,3 +116,4 @@ <input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php p($_['allowZipDownload']); ?>" /> <input type="hidden" name="usedSpacePercent" id="usedSpacePercent" value="<?php p($_['usedSpacePercent']); ?>" /> <input type="hidden" name="encryptedFiles" id="encryptedFiles" value="<?php $_['encryptedFiles'] ? p('1') : p('0'); ?>" /> +<input type="hidden" name="encryptedInitStatus" id="encryptionInitStatus" value="<?php p($_['encryptionInitStatus']) ?>" /> |