summaryrefslogtreecommitdiffstats
path: root/lib/private/util.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-08-31 15:21:09 +0200
committerLukas Reschke <lukas@owncloud.com>2014-08-31 15:21:09 +0200
commitae3425d2dadbac69e7dcb0ba577db20e63e7d91f (patch)
treef483759739cd951c33ef1c61ade8694f9e1c95e3 /lib/private/util.php
parent3329e0f2b22207a24ddb4953bbf11964b23682d9 (diff)
parent73685892ed6f255a916512863cd5549914d071e1 (diff)
downloadnextcloud-server-ae3425d2dadbac69e7dcb0ba577db20e63e7d91f.tar.gz
nextcloud-server-ae3425d2dadbac69e7dcb0ba577db20e63e7d91f.zip
Merge branch 'master' into securityutils
Conflicts: lib/private/util.php
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-xlib/private/util.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index b2a9aecb5d0..8fae5189ca2 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -384,15 +384,15 @@ class OC_Util {
* @return string timestamp
* @description adjust to clients timezone if we know it
*/
- public static function formatDate($timestamp, $dateOnly = false) {
- if (\OC::$session->exists('timezone')) {
+ public static function formatDate( $timestamp, $dateOnly = false) {
+ if(\OC::$server->getSession()->exists('timezone')) {
$systemTimeZone = intval(date('O'));
$systemTimeZone = (round($systemTimeZone / 100, 0) * 60) + ($systemTimeZone % 100);
- $clientTimeZone = \OC::$session->get('timezone') * 60;
+ $clientTimeZone = \OC::$server->getSession()->get('timezone') * 60;
$offset = $clientTimeZone - $systemTimeZone;
$timestamp = $timestamp + $offset * 60;
}
- $l = OC_L10N::get('lib');
+ $l = \OC::$server->getL10N('lib');
return $l->l($dateOnly ? 'date' : 'datetime', $timestamp);
}
@@ -402,7 +402,7 @@ class OC_Util {
* @return array arrays with error messages and hints
*/
public static function checkServer() {
- $l = OC_L10N::get('lib');
+ $l = \OC::$server->getL10N('lib');
$errors = array();
$CONFIG_DATADIRECTORY = OC_Config::getValue('datadirectory', OC::$SERVERROOT . '/data');
@@ -412,7 +412,7 @@ class OC_Util {
}
// Assume that if checkServer() succeeded before in this session, then all is fine.
- if (\OC::$session->exists('checkServer_succeeded') && \OC::$session->get('checkServer_succeeded')) {
+ if (\OC::$server->getSession()->exists('checkServer_succeeded') && \OC::$server->getSession()->get('checkServer_succeeded')) {
return $errors;
}
@@ -615,7 +615,7 @@ class OC_Util {
$errors = array_merge($errors, self::checkDatabaseVersion());
// Cache the result of this function
- \OC::$session->set('checkServer_succeeded', count($errors) == 0);
+ \OC::$server->getSession()->set('checkServer_succeeded', count($errors) == 0);
return $errors;
}
@@ -626,7 +626,7 @@ class OC_Util {
* @return array errors array
*/
public static function checkDatabaseVersion() {
- $l = OC_L10N::get('lib');
+ $l = \OC::$server->getL10N('lib');
$errors = array();
$dbType = \OC_Config::getValue('dbtype', 'sqlite');
if ($dbType === 'pgsql') {
@@ -707,7 +707,7 @@ class OC_Util {
* @return array arrays with error messages and hints
*/
public static function checkDataDirectoryPermissions($dataDirectory) {
- $l = OC_L10N::get('lib');
+ $l = \OC::$server->getL10N('lib');
$errors = array();
if (self::runningOnWindows()) {
//TODO: permissions checks for windows hosts
@@ -738,7 +738,7 @@ class OC_Util {
* @return bool true if the data directory is valid, false otherwise
*/
public static function checkDataDirectoryValidity($dataDirectory) {
- $l = OC_L10N::get('lib');
+ $l = \OC::$server->getL10N('lib');
$errors = array();
if (!file_exists($dataDirectory . '/.ocdata')) {
$errors[] = array(
@@ -938,13 +938,13 @@ class OC_Util {
*/
public static function callRegister() {
// Check if a token exists
- if (!\OC::$session->exists('requesttoken')) {
+ if (!\OC::$server->getSession()->exists('requesttoken')) {
// No valid token found, generate a new one.
$requestToken = self::generateRandomBytes(20);
- \OC::$session->set('requesttoken', $requestToken);
+ \OC::$server->getSession()->set('requesttoken', $requestToken);
} else {
// Valid token already exists, send it
- $requestToken = \OC::$session->get('requesttoken');
+ $requestToken = \OC::$server->getSession()->get('requesttoken');
}
return ($requestToken);
}