From 9520f3783a14ad5a946ff921ca4bcb0349448816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Gl=C3=B6ggler?= Date: Fri, 18 Mar 2022 11:22:14 +0100 Subject: [PATCH] use session to store debug mode --- classes/OCRestClient/OCRestClient.php | 2 +- controllers/course.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/OCRestClient/OCRestClient.php b/classes/OCRestClient/OCRestClient.php index f6d60b0e3..e189c14ef 100644 --- a/classes/OCRestClient/OCRestClient.php +++ b/classes/OCRestClient/OCRestClient.php @@ -87,7 +87,7 @@ private function initCurl() // check, if debugging is enabled if (Context::getId()) { - if (boolval(\CourseConfig::get(Context::getId())->OPENCAST_DEBUG_CURL)) { + if (boolval(@$_SESSION['OPENCAST_DEBUG_CURL'][Context::getId()])) { $this->debug_curl = true; curl_setopt($this->ochandler, CURLOPT_VERBOSE, true); } diff --git a/controllers/course.php b/controllers/course.php index 090bcf92e..d2e7ec6b4 100644 --- a/controllers/course.php +++ b/controllers/course.php @@ -87,7 +87,7 @@ public function before_filter(&$action, &$args) } } - $this->debug = boolval(CourseConfig::get(Context::getId())->OPENCAST_DEBUG_CURL); + $this->debug = boolval(@$_SESSION['OPENCAST_DEBUG_CURL'][Context::getId()]); } /** @@ -254,11 +254,11 @@ public function search_episodes_action() public function debug_action($ticket) { if ($GLOBALS['perm']->have_perm('root') && check_ticket($ticket)) { - CourseConfig::get($this->course_id)->store('OPENCAST_DEBUG_CURL', - !boolval(CourseConfig::get(Context::getId())->OPENCAST_DEBUG_CURL) - ); + @$_SESSION['OPENCAST_DEBUG_CURL'][Context::getId()] + = boolval(@!$_SESSION['OPENCAST_DEBUG_CURL'][Context::getId()]); + - if (boolval(CourseConfig::get(Context::getId())->OPENCAST_DEBUG_CURL)) { + if (boolval(@$_SESSION['OPENCAST_DEBUG_CURL'][Context::getId()])) { PageLayout::postInfo($this->_('Debugging ist nun eingeschaltet für diesen Kurs.')); } else { PageLayout::postInfo($this->_('Debugging ist nun ausgeschaltet für diesen Kurs.'));