Skip to content

Commit

Permalink
use session to store debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl committed Mar 18, 2022
1 parent 4bd0103 commit 9520f37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion classes/OCRestClient/OCRestClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions controllers/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()]);
}

/**
Expand Down Expand Up @@ -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.'));
Expand Down

0 comments on commit 9520f37

Please sign in to comment.