aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/session.php
diff options
context:
space:
mode:
authoricewind1991 <icewind1991@gmail.com>2013-05-28 13:37:39 -0700
committericewind1991 <icewind1991@gmail.com>2013-05-28 13:37:39 -0700
commitfee43ec506ee423f67ddae0a9ef29a3135b99ab6 (patch)
treee33dd76c10f0002f2e8d41c5c35827e9804d6f7c /apps/files_encryption/lib/session.php
parent1d720099c328fe3084e05fe3d2bdd9e49acb8dfe (diff)
parentfa6bfe8837c5f22e724df97c7049d60c1bb904ff (diff)
downloadnextcloud-server-fee43ec506ee423f67ddae0a9ef29a3135b99ab6.tar.gz
nextcloud-server-fee43ec506ee423f67ddae0a9ef29a3135b99ab6.zip
Merge pull request #3511 from owncloud/sessionclass
Abstract session access away in a class
Diffstat (limited to 'apps/files_encryption/lib/session.php')
-rw-r--r--apps/files_encryption/lib/session.php24
1 files changed, 10 insertions, 14 deletions
diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index 1551275c63f..d60c386fb1c 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -105,7 +105,7 @@ class Session
*/
public function setPrivateKey( $privateKey ) {
- $_SESSION['privateKey'] = $privateKey;
+ \OC::$session->set('privateKey', $privateKey);
return true;
@@ -122,8 +122,8 @@ class Session
if (\OCA\Encryption\Helper::isPublicAccess()) {
return $this->getPublicSharePrivateKey();
} else {
- if (isset($_SESSION['privateKey']) && !empty($_SESSION['privateKey'])) {
- return $_SESSION['privateKey'];
+ if (!is_null( \OC::$session->get('privateKey') )) {
+ return \OC::$session->get('privateKey');
} else {
return false;
}
@@ -137,7 +137,7 @@ class Session
*/
public function setPublicSharePrivateKey($privateKey) {
- $_SESSION['publicSharePrivateKey'] = $privateKey;
+ \OC::$session->set('publicSharePrivateKey', $privateKey);
return true;
@@ -150,12 +150,11 @@ class Session
*/
public function getPublicSharePrivateKey() {
- if (isset($_SESSION['publicSharePrivateKey']) && !empty($_SESSION['publicSharePrivateKey'])) {
- return $_SESSION['publicSharePrivateKey'];
+ if (!is_null( \OC::$session->get('publicSharePrivateKey') )) {
+ return \OC::$session->get('publicSharePrivateKey');
} else {
return false;
}
-
}
@@ -166,7 +165,7 @@ class Session
*/
public function setLegacyKey( $legacyKey ) {
- $_SESSION['legacyKey'] = $legacyKey;
+ \OC::$session->set('legacyKey', $legacyKey);
return true;
}
@@ -178,12 +177,9 @@ class Session
*/
public function getLegacyKey() {
- if (
- isset( $_SESSION['legacyKey'] )
- && !empty( $_SESSION['legacyKey'] )
- ) {
+ if ( !is_null( \OC::$session->get('legacyKey') ) ) {
- return $_SESSION['legacyKey'];
+ return \OC::$session->get('legacyKey');
} else {
@@ -193,4 +189,4 @@ class Session
}
-} \ No newline at end of file
+}