Skip to content
Snippets Groups Projects
Commit f7d60f11 authored by Björn Schießle's avatar Björn Schießle
Browse files

Merge pull request #9951 from owncloud/enc_inproved_error_messages

show a warning in the personal settings and admin settins if the encyption keys are not initialized
parents a36c4402 de4233bc
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,11 @@ $tmpl = new OCP\Template('files_encryption', 'settings-admin');
// Check if an adminRecovery account is enabled for recovering files after lost pwd
$recoveryAdminEnabled = \OC::$server->getAppConfig()->getValue('files_encryption', 'recoveryAdminEnabled', '0');
$session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
$initStatus = $session->getInitialized();
$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);
$tmpl->assign('initStatus', $initStatus);
\OCP\Util::addscript('files_encryption', 'settings-admin');
\OCP\Util::addscript('core', 'multiselect');
......
<form id="encryption" class="section">
<h2><?php p($l->t('Encryption')); ?></h2>
<?php if($_["initStatus"] === \OCA\Encryption\Session::NOT_INITIALIZED): ?>
<?php p($l->t("Encryption App is enabled but your keys are not initialized, please log-out and log-in again")); ?>
<?php else: ?>
<p>
<?php p($l->t("Enable recovery key (allow to recover users files in case of password loss):")); ?>
<br/>
......@@ -57,4 +60,5 @@
</button>
<span class="msg"></span>
</p>
<?php endif; ?>
</form>
<form id="encryption" class="section">
<h2><?php p( $l->t( 'Encryption' ) ); ?></h2>
<?php if ( $_["initialized"] === '1' ): ?>
<?php if ( $_["initialized"] === \OCA\Encryption\Session::NOT_INITIALIZED ): ?>
<?php p($l->t("Encryption App is enabled but your keys are not initialized, please log-out and log-in again")); ?>
<?php elseif ( $_["initialized"] === \OCA\Encryption\Session::INIT_EXECUTED ): ?>
<p>
<a name="changePKPasswd" />
<label for="changePrivateKeyPasswd">
......@@ -33,9 +37,8 @@
</button>
<span class="msg"></span>
</p>
<?php endif; ?>
<?php if ( $_["recoveryEnabled"] && $_["privateKeySet"] ): ?>
<?php elseif ( $_["recoveryEnabled"] && $_["privateKeySet"] && $_["initialized"] === \OCA\Encryption\Session::INIT_SUCCESSFUL ): ?>
<br />
<p>
<label for="userEnableRecovery"><?php p( $l->t( "Enable password recovery:" ) ); ?></label>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment