Skip to content

Commit

Permalink
Log Eintrag für TOS (#474)
Browse files Browse the repository at this point in the history
* log, wenn TOS akzeptiert

* log for reject. cleaner output
  • Loading branch information
ssrahn authored May 4, 2021
1 parent 1400c6f commit 7366712
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public function tos_action()

public function accept_tos_action()
{
StudipLog::log('OC_TOS', $this->course_id, null, "akzeptiert");
if (!Config::get()->OPENCAST_SHOW_TOS || !OCPerm::editAllowed($this->course_id)) {
return $this->redirect('course/index');
}
Expand All @@ -257,6 +258,7 @@ public function accept_tos_action()

public function withdraw_tos_action()
{
StudipLog::log('OC_TOS', $this->course_id, null, "abgelehnt");
if (!Config::get()->OPENCAST_SHOW_TOS || !OCPerm::editAllowed($this->course_id)) {
return $this->redirect('course/index');
}
Expand Down
23 changes: 23 additions & 0 deletions migrations/038_add_log_tos.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

class AddLogTos extends Migration {

function up()
{
$db = DBManager::get();
$query = $db->prepare("INSERT INTO log_actions (action_id, name, description, info_template, active) VALUES (?, ?, ?, ?, ?)");

$query->execute(array(md5('OC_TOS'), 'OC_TOS', 'Opencast: TOS akzeptiert/abgelehnt', '%user hat TOS %info in %sem(%affected)', 1));
}

function down()
{
$db = DBManager::get();
$query = $db->prepare("DELETE FROM log_actions WHERE action_id = ?");
$query2 = $db->prepare("DELETE FROM log_events WHERE action_id = ?");
$query->execute(array(md5('OC_TOS')));
$query2->execute(array(md5('OC_TOS')));
}
}

?>

0 comments on commit 7366712

Please sign in to comment.