aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-30 20:28:00 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-30 20:28:00 +0200
commit7c659eb2917795ef2dd7ada24c00d7db861a5aec (patch)
treef43f98ae319b0c8b207f9b8d49668695697f30da
parentbed27b603de1b5eb736d123fd58b774c7f79a4fd (diff)
downloadnextcloud-server-7c659eb2917795ef2dd7ada24c00d7db861a5aec.tar.gz
nextcloud-server-7c659eb2917795ef2dd7ada24c00d7db861a5aec.zip
use public api for session access from server container
-rwxr-xr-xlib/util.php30
1 files changed, 18 insertions, 12 deletions
diff --git a/lib/util.php b/lib/util.php
index 36969f096fa..ea2eb98d23c 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -107,7 +107,7 @@ class OC_Util {
*/
public static function getVersion() {
OC_Util::loadVersion();
- return $_SESSION['OC_Version'];
+ return \OC::$server->getSession()->get('OC_Version');
}
/**
@@ -116,7 +116,7 @@ class OC_Util {
*/
public static function getVersionString() {
OC_Util::loadVersion();
- return $_SESSION['OC_VersionString'];
+ return \OC::$server->getSession()->get('OC_VersionString');
}
/**
@@ -127,7 +127,7 @@ class OC_Util {
*/
public static function getEditionString() {
OC_Util::loadVersion();
- return $_SESSION['OC_Edition'];
+ return \OC::$server->getSession()->get('OC_Edition');
}
/**
@@ -136,7 +136,7 @@ class OC_Util {
*/
public static function getChannel() {
OC_Util::loadVersion();
- return $_SESSION['OC_Channel'];
+ return \OC::$server->getSession()->get('OC_Channel');
}
/**
@@ -145,20 +145,26 @@ class OC_Util {
*/
public static function getBuild() {
OC_Util::loadVersion();
- return $_SESSION['OC_Build'];
+ return \OC::$server->getSession()->get('OC_Build');
}
/**
* @description load the version.php into the session as cache
*/
private static function loadVersion() {
- if(!isset($_SESSION['OC_Version'])){
- require('version.php');
- $_SESSION['OC_Version']=$OC_Version;
- $_SESSION['OC_VersionString']=$OC_VersionString;
- $_SESSION['OC_Edition']=$OC_Edition;
- $_SESSION['OC_Channel']=$OC_Channel;
- $_SESSION['OC_Build']=$OC_Build;
+ if(!\OC::$server->getSession()->exists('OC_Version')) {
+ require 'version.php';
+ $session = \OC::$server->getSession();
+ /** @var $OC_Version string */
+ $session->set('OC_Version', $OC_Version);
+ /** @var $OC_VersionString string */
+ $session->set('OC_VersionString', $OC_VersionString);
+ /** @var $OC_Edition string */
+ $session->set('OC_Edition', $OC_Edition);
+ /** @var $OC_Channel string */
+ $session->set('OC_Channel', $OC_Channel);
+ /** @var $OC_Build string */
+ $session->set('OC_Build', $OC_Build);
}
}