diff options
author | Sam Tuke <samtuke@owncloud.com> | 2013-02-05 18:43:55 +0000 |
---|---|---|
committer | Sam Tuke <samtuke@owncloud.com> | 2013-02-05 18:43:55 +0000 |
commit | 3b9e2f1babd578312377f846b2da4d30b550c37f (patch) | |
tree | 6f965d04be8ac4a30f029c08aa7f147f1d0fb449 /apps/files_encryption/lib/session.php | |
parent | a528f96b842e387f153e4f38d87aebd26ccd39b7 (diff) | |
parent | e6400b305987977d867f1592f3231167903b70b1 (diff) | |
download | nextcloud-server-3b9e2f1babd578312377f846b2da4d30b550c37f.tar.gz nextcloud-server-3b9e2f1babd578312377f846b2da4d30b550c37f.zip |
Merge branch 'master' into files_encryption-style-fixes
Conflicts:
apps/files_encryption/lib/crypt.php
apps/files_encryption/lib/keymanager.php
Diffstat (limited to 'apps/files_encryption/lib/session.php')
-rw-r--r-- | apps/files_encryption/lib/session.php | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php index 85d533fde7a..769a40b359f 100644 --- a/apps/files_encryption/lib/session.php +++ b/apps/files_encryption/lib/session.php @@ -29,11 +29,11 @@ namespace OCA\Encryption; class Session { /** - * @brief Sets user id for session and triggers emit + * @brief Sets user private key to session * @return bool * */ - public function setPrivateKey( $privateKey, $userId ) { + public function setPrivateKey( $privateKey ) { $_SESSION['privateKey'] = $privateKey; @@ -42,15 +42,15 @@ class Session { } /** - * @brief Gets user id for session and triggers emit + * @brief Gets user private key from session * @returns string $privateKey The user's plaintext private key * */ - public function getPrivateKey( $userId ) { + public function getPrivateKey() { if ( - isset( $_SESSION['privateKey'] ) - && !empty( $_SESSION['privateKey'] ) + isset( $_SESSION['privateKey'] ) + && !empty( $_SESSION['privateKey'] ) ) { return $_SESSION['privateKey']; @@ -62,5 +62,42 @@ class Session { } } + + /** + * @brief Sets user legacy key to session + * @return bool + * + */ + public function setLegacyKey( $legacyKey ) { + + if ( $_SESSION['legacyKey'] = $legacyKey ) { + + return true; + + } + + } + + /** + * @brief Gets user legacy key from session + * @returns string $legacyKey The user's plaintext legacy key + * + */ + public function getLegacyKey() { + + if ( + isset( $_SESSION['legacyKey'] ) + && !empty( $_SESSION['legacyKey'] ) + ) { + + return $_SESSION['legacyKey']; + + } else { + + return false; + + } + + } }
\ No newline at end of file |