This commit is contained in:
Thomas Müller 2015-04-02 13:12:05 +02:00
parent e8e5bd61ae
commit 8cf9b423d5
3 changed files with 15 additions and 29 deletions

View File

@ -201,7 +201,7 @@ class UserHooks implements IHook {
} }
} }
/** /**
* Change a user's encryption passphrase * Change a user's encryption passphrase
* *
* @param array $params keys: uid, password * @param array $params keys: uid, password
@ -225,7 +225,7 @@ class UserHooks implements IHook {
$this->keyManager->setPrivateKey($this->user->getUser()->getUID(), $this->keyManager->setPrivateKey($this->user->getUser()->getUID(),
$encryptedPrivateKey); $encryptedPrivateKey);
} else { } else {
$this->log->error('Encryption could not update users encryption password'); $this->logger->error('Encryption could not update users encryption password');
} }
// NOTE: Session does not need to be updated as the // NOTE: Session does not need to be updated as the
@ -266,7 +266,7 @@ class UserHooks implements IHook {
$this->recovery->recoverUsersFiles($recoveryPassword, $user); $this->recovery->recoverUsersFiles($recoveryPassword, $user);
} }
} else { } else {
$this->log->error('Encryption Could not update users encryption password'); $this->logger->error('Encryption Could not update users encryption password');
} }
} }
} }

View File

@ -6,33 +6,31 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
// Add CSS stylesheet
\OC_Util::addStyle('encryption', 'settings-personal');
$session = new \OCA\Encryption\Session(\OC::$server->getSession()); $session = new \OCA\Encryption\Session(\OC::$server->getSession());
$userSession = \OC::$server->getUserSession();
$tmpl = new OCP\Template('encryption', 'settings-personal'); $template = new OCP\Template('encryption', 'settings-personal');
$crypt = new \OCA\Encryption\Crypto\Crypt( $crypt = new \OCA\Encryption\Crypto\Crypt(
\OC::$server->getLogger(), \OC::$server->getLogger(),
\OC::$server->getUserSession(), $userSession,
\OC::$server->getConfig()); \OC::$server->getConfig());
$util = new \OCA\Encryption\Util( $util = new \OCA\Encryption\Util(
new \OC\Files\View(), new \OC\Files\View(),
$crypt, $crypt,
\OC::$server->getLogger(), \OC::$server->getLogger(),
\OC::$server->getUserSession(), $userSession,
\OC::$server->getConfig()); \OC::$server->getConfig());
$keymanager = new \OCA\Encryption\KeyManager( $keyManager = new \OCA\Encryption\KeyManager(
\OC::$server->getEncryptionKeyStorage(\OCA\Encryption\Crypto\Encryption::ID), \OC::$server->getEncryptionKeyStorage(\OCA\Encryption\Crypto\Encryption::ID),
$crypt, $crypt,
\OC::$server->getConfig(), \OC::$server->getConfig(),
\OC::$server->getUserSession(), $userSession,
$session, $session,
\OC::$server->getLogger(), $util); \OC::$server->getLogger(), $util);
$user = \OCP\User::getUser(); $user = $userSession->getUser()->getUID();
$view = new \OC\Files\View('/'); $view = new \OC\Files\View('/');
@ -48,12 +46,12 @@ $recoveryEnabledForUser = $util->isRecoveryEnabledForUser();
$result = false; $result = false;
if ($recoveryAdminEnabled || !$privateKeySet) { if ($recoveryAdminEnabled || !$privateKeySet) {
$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled); $template->assign('recoveryEnabled', $recoveryAdminEnabled);
$tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser); $template->assign('recoveryEnabledForUser', $recoveryEnabledForUser);
$tmpl->assign('privateKeySet', $privateKeySet); $template->assign('privateKeySet', $privateKeySet);
$tmpl->assign('initialized', $initialized); $template->assign('initialized', $initialized);
$result = $tmpl->fetchPage(); $result = $template->fetchPage();
} }
return $result; return $result;

View File

@ -1,12 +0,0 @@
<ul>
<li class='error'>
<?php $location = \OC_Helper::linkToRoute( "settings_personal" ).'#changePKPasswd' ?>
<?php p($_['message']); ?>
<br/>
<?php if($_['errorCode'] === \OCA\Files_Encryption\Crypt::ENCRYPTION_PRIVATE_KEY_NOT_VALID_ERROR): ?>
<?php p($l->t('Go directly to your %spersonal settings%s.', array('<a href="'.$location.'">', '</a>'))); ?>
<?php endif; ?>
<br/>
</li>
</ul>