aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-08-24 12:00:37 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-08-24 15:14:05 +0200
commite88b380973b54bc7b8bc86f888b1f11ae8e54076 (patch)
treeeb26a996febd377d21d756fdddd884a1a2ea451d /lib/base.php
parenta67a2272e77485391695af84644e7a9074e50af8 (diff)
downloadnextcloud-server-e88b380973b54bc7b8bc86f888b1f11ae8e54076.tar.gz
nextcloud-server-e88b380973b54bc7b8bc86f888b1f11ae8e54076.zip
Remove DEBUG constant and use config value
* introduces config.php option 'debug' that defaults to false * migrate DEBUG constant to config value
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/base.php b/lib/base.php
index 2435661dfa6..aceac2e53c3 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -582,7 +582,7 @@ class OC {
if (!defined('PHPUNIT_RUN')) {
$logger = \OC::$server->getLogger();
OC\Log\ErrorHandler::setLogger($logger);
- if (defined('DEBUG') and DEBUG) {
+ if (\OC::$server->getConfig()->getSystemValue('debug', false)) {
OC\Log\ErrorHandler::register(true);
set_exception_handler(array('OC_Template', 'printExceptionErrorPage'));
} else {
@@ -1040,7 +1040,7 @@ class OC {
return false;
}
- if (defined("DEBUG") && DEBUG) {
+ if (\OC::$server->getConfig()->getSystemValue('debug', false)) {
\OCP\Util::writeLog('core', 'Trying to login from cookie', \OCP\Util::DEBUG);
}
@@ -1093,11 +1093,12 @@ class OC {
self::cleanupLoginTokens($userId);
if (!empty($_POST["remember_login"])) {
- if (defined("DEBUG") && DEBUG) {
+ $config = self::$server->getConfig();
+ if ($config->getSystemValue('debug', false)) {
self::$server->getLogger()->debug('Setting remember login to cookie', array('app' => 'core'));
}
$token = \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate(32);
- self::$server->getConfig()->setUserValue($userId, 'login_token', $token, time());
+ $config->setUserValue($userId, 'login_token', $token, time());
OC_User::setMagicInCookie($userId, $token);
} else {
OC_User::unsetMagicInCookie();