diff options
| author | Murtaza Sultani <sultani@data-quest.de> | 2025-07-28 17:23:38 +0200 |
|---|---|---|
| committer | Murtaza Sultani <sultani@data-quest.de> | 2025-07-28 17:23:38 +0200 |
| commit | 28a9e7237135aa6a4f6beb69bda09a28d52d31a4 (patch) | |
| tree | c4f9e6dcb68808fda7cb0b6c9899fd3ef777638a /app/controllers/course/forum/topics.php | |
| parent | 1352f30ea1a3fd4401e0e7eba988c560c7fc9585 (diff) | |
Resolve "Forum verwendet falsche Rechteabfragen in der JSON-API"
Closes #5753
Merge request studip/studip!4386
Diffstat (limited to 'app/controllers/course/forum/topics.php')
| -rw-r--r-- | app/controllers/course/forum/topics.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/app/controllers/course/forum/topics.php b/app/controllers/course/forum/topics.php index a72da84..b6a1307 100644 --- a/app/controllers/course/forum/topics.php +++ b/app/controllers/course/forum/topics.php @@ -1,11 +1,11 @@ <?php -require_once 'ForumBaseController.php'; +require_once 'BaseController.php'; -use Forum\ForumCategory; -use Forum\ForumSubscription; -use Forum\ForumTopic; +use Forum\Category; +use Forum\Subscription; +use Forum\Topic; -class Course_Forum_TopicsController extends Forum\ForumBaseController +class Course_Forum_TopicsController extends Forum\BaseController { public function before_filter(&$action, &$args) { @@ -25,7 +25,7 @@ class Course_Forum_TopicsController extends Forum\ForumBaseController public function show_action($topic_id) { - $topic = ForumTopic::find($topic_id); + $topic = Topic::find($topic_id); if (!$topic) { throw new AccessDeniedException(); @@ -33,7 +33,7 @@ class Course_Forum_TopicsController extends Forum\ForumBaseController PageLayout::setTitle($topic->name); - $user_subscription = ForumSubscription::findOneBySQL( + $user_subscription = Subscription::findOneBySQL( "subject = :subject AND subject_id = :subject_id AND user_id = :user_id", [ 'subject' => 'topic', @@ -65,14 +65,14 @@ class Course_Forum_TopicsController extends Forum\ForumBaseController if ($topic_id) { PageLayout::setTitle(_('Thema bearbeiten')); - $topic = ForumTopic::getCourseTopic($this->range_id, $topic_id); + $topic = Topic::getCourseTopic($this->range_id, $topic_id); if (!$topic) { throw new AccessDeniedException(); } } else { PageLayout::setTitle(_('Neues Thema anlegen')); - $topic = new ForumTopic(); + $topic = new Topic(); $topic['category_id'] = Request::get('category_id'); } @@ -99,19 +99,19 @@ class Course_Forum_TopicsController extends Forum\ForumBaseController CSRFProtection::verifyUnsafeRequest(); if ($topic_id) { - $topic = ForumTopic::getCourseTopic($this->range_id, $topic_id); + $topic = Topic::getCourseTopic($this->range_id, $topic_id); if (!$topic) { throw new AccessDeniedException(); } } else { - $topic = new ForumTopic(); + $topic = new Topic(); $topic->range_id = $this->range_id; } $category = json_decode(Request::get('category'), true); if (empty($category['category_id']) && !empty($category['name'])) { - $newCategory = ForumCategory::create([ + $newCategory = Category::create([ 'range_id' => $this->range_id, 'color' => '#28497C', 'name' => $category['name'] @@ -142,7 +142,7 @@ class Course_Forum_TopicsController extends Forum\ForumBaseController throw new AccessDeniedException(); } - $topic = ForumTopic::getCourseTopic($this->range_id, $topic_id); + $topic = Topic::getCourseTopic($this->range_id, $topic_id); if (!$topic) { throw new AccessDeniedException(); |
